<template>
	<div class="mainWrapper abnormal">
		<el-breadcrumb separator="/">
			<el-breadcrumb-item :to="{ path: '/' }"><i class="lh lh-diaodu fw_100"></i></el-breadcrumb-item>
			<el-breadcrumb-item>调度中心</el-breadcrumb-item>
			<el-breadcrumb-item>全景调度</el-breadcrumb-item>
		</el-breadcrumb>

		<div class="content_Box box-shadow">
			<div class="pt_5 px_15">
				<el-form :inline="true" :model="ruleForm" class="form-inline" @keyup.enter.native="shearchBtn()">
					<el-form-item
						><el-input
							size="mini"
							class="w_140"
							v-model="task_sn"
							placeholder="任务编号"
							:disabled="task_sn_disabled"
						></el-input
					></el-form-item>
					<el-form-item
						><el-input
							size="mini"
							class="w_120"
							v-model="demand_sn"
							placeholder="订单编号"
							:disabled="demand_sn_disabled"
						></el-input
					></el-form-item>
					<el-form-item
						><el-input
							size="mini"
							class="w_80"
							v-model="staff_name"
							placeholder="接单人"
							:disabled="staff_name_disabled"
						></el-input
					></el-form-item>
					<el-form-item
						><el-input
							size="mini"
							class="w_110"
							v-model="mobile"
							placeholder="手机号"
							:disabled="mobile_disabled"
						></el-input
					></el-form-item>

					<el-form-item>
						<el-autocomplete
							size="mini"
							class="w_130"
							v-model="shop_name"
							:fetch-suggestions="querySearch"
							placeholder="店铺名称"
							:trigger-on-focus="true"
							@select="handleSelect"
							:disabled="shop_name_disabled"
						></el-autocomplete>
					</el-form-item>

					<el-form-item>
						<!-- <el-select size="mini" class="w_110" v-model="area_arr" placeholder="商圈" @change="changeBtndialogarea">
                      <el-option v-for="item in areaList" :key="item.id" :label="item.area_name" :value="`${item.id}|${item.area_name}`"></el-option>
                    </el-select> -->
						<el-select v-model="s_time_slot" multiple collapse-tags placeholder="商圈" @change="changeBtndialogarea">
							<el-button
								size="mini"
								type="primary"
								class="round-right all-area"
								@click="selectAllArea()"
								native-type="button"
								>{{ areaStatus ? '全选' : '取消全选' }}</el-button
							>
							<el-option
								v-for="item in areaList"
								:key="item.id"
								:label="item.area_name"
								:value="`${item.id}|${item.area_name}`"
							></el-option>
						</el-select>
					</el-form-item>

					<el-form-item prop="date1">
						<el-date-picker
							size="mini"
							type="datetime"
							class="w_120i"
							value-format="yyyy-MM-dd HH:mm:ss"
							format="MM-dd HH:mm"
							placeholder="开始时间"
							v-model="ruleForm.date1"
						></el-date-picker> </el-form-item
					>~
					<el-form-item prop="date2">
						<el-date-picker
							size="mini"
							type="datetime"
							class="w_120i"
							value-format="yyyy-MM-dd HH:mm:ss"
							format="MM-dd HH:mm"
							placeholder="结束时间"
							v-model="ruleForm.date2"
						></el-date-picker>
					</el-form-item>

					<el-button size="mini" type="primary" class="round-right" @click="shearchBtn()" native-type="button"
						>搜索</el-button
					>
					<el-button size="mini" round @click="resetBtn">重置</el-button>
				</el-form>
			</div>
			<div class="pb_5 px_15 mb_5" id="dd-row-2">
				<el-row>
					<el-col :span="14">
						<el-button size="mini" class="fl" :type="status == 100 ? 'danger' : 'default'" @click="tagstate(100)"
							>异常({{ statistic.abnormal }})</el-button
						>
						<el-button
							v-if="status == 10"
							size="mini"
							class="fl"
							:type="status == 10 ? 'warning' : 'default'"
							@click="tagstate(10)"
							>待分配({{ statistic.assigning }})</el-button
						>
						<el-button
							v-if="status != 10"
							size="mini"
							class="fl"
							:type="status == 10 ? 'warning' : 'default'"
							@click="tagstate(10)"
							>待分配({{ (statistic.assigning *= 1) + (statistic.withdraw *= 1) }})</el-button
						>
						<el-button size="mini" class="fl" :type="status == 20 ? 'warning' : 'default'" @click="tagstate(20)"
							>待确认({{ statistic.assigned }})</el-button
						>
						<el-button size="mini" class="fl" :type="status == 30 ? 'primary' : 'default'" @click="tagstate(30)"
							>待签到({{ statistic.accept }})</el-button
						>
						<el-button size="mini" class="fl" :type="status == 40 ? 'primary' : 'default'" @click="tagstate(40)"
							>进行中({{ statistic.checkin }})</el-button
						>
						<el-button size="mini" class="fl" :type="status == 70 ? 'warning' : 'default'" @click="tagstate(70)"
							>已取消({{ statistic.cancel }})</el-button
						>
						<el-button size="mini" class="fl" :type="status == 50 ? 'success' : 'default'" @click="tagstate(50)"
							>已完成({{ statistic.finish }})</el-button
						>
					</el-col>

					<el-col :span="10">
						<!-- 简洁分页组件 -->
						<pagemini :total="total" class="fr" :pageNums="pageNum" @pagedata="onChildValue"></pagemini>
					</el-col>
				</el-row>
			</div>

			<div class="tableMaxBox">
				<template>
					<el-table
						:data="demandList"
						stripe
						ref="multipleTable"
						@selection-change="handleSelectionChange"
						:show-overflow-tooltip="false"
						height="360"
					>
						<el-table-column type="selection" v-if="status == 10" align="center" width="50"></el-table-column>
						<el-table-column prop="task_sn" label="任务编号" width="130px">
							<template slot-scope="{ row, $index }">
								<span class="pointer u text-primary" @click="goToMoreList(row)">{{ row.task_sn }}</span>
							</template>
						</el-table-column>
						<el-table-column prop="total" label="接单人" width="140">
							<template slot-scope="{ row, $index }">
								<span class="text-success pointer" @click="toPersonnelListHx(row)"
									>{{ row.staff_name }} {{ row.mobile }}</span
								>
							</template>
						</el-table-column>
						<el-table-column prop="shop_name" label="店铺名称" width="170">
							<template slot-scope="{ row, $index }">
								<el-tooltip effect="dark" placement="top" v-if="row.shop_remark != '' || row.shop_contact != ''">
									<div slot="content">
										<span class="">店铺负责人：{{ row.shop_contact }}&nbsp;&nbsp;{{ row.shop_contact_phone }}</span>
										<span class="tooltip">{{ row.shop_remark }}</span>
									</div>
									<div>
										<span
											v-if="row.shop_is_halal == 1"
											style="background: #c93a32; color: #fff; padding: 2px 3px; border-radius: 3px;"
											>清真</span
										>
										<!-- <span class="pointer u text-primary" @click="shop_map(row.location.coordinates,row.shop_name)">{{row.shop_name}}</span> -->
										<span class="pointer u text-primary" @click="shopLists(row)">{{ row.shop_name }}</span>
									</div>
								</el-tooltip>
								<div v-if="row.shop_remark == '' && row.shop_contact == ''">
									<div>
										<span
											v-if="row.shop_is_halal == 1"
											style="background: #c93a32; color: #fff; padding: 2px 3px; border-radius: 3px;"
											>清真</span
										>
										<!-- <span class="pointer u text-primary" @click="shop_map(row.location.coordinates,row.shop_name)">{{row.shop_name}}</span> -->
										<span class="pointer u text-primary" @click="shopLists(row)">{{ row.shop_name }}</span>
									</div>
								</div>
							</template>
						</el-table-column>
						<el-table-column prop="sn" label="订单编号" width="110">
							<template slot-scope="{ row, $index }">
								<span class="pointer u text-primary" @click="goToMore(row)">{{ row.demand_sn }}</span>
							</template>
						</el-table-column>
						<el-table-column prop="area_name" label="商圈" width="110"></el-table-column>
						<el-table-column prop="label_name" label="任务名称" width="110">
							<template slot-scope="{ row, $index }">
								<span>{{ row.job_name }} {{ row.hour_expect }}h</span>
							</template>
						</el-table-column>
						<el-table-column prop="period" label="天数D" width="60" align="center"></el-table-column>
						<el-table-column prop="start_date" label="任务开始 ~ 结束时间" width="200px">
							<template slot-scope="{ row, $index }">
								<span>{{ row.start_date }} {{ row.start_time }}~{{ row.end_time }}</span>
							</template>
						</el-table-column>
						<el-table-column prop="task_description" width="200" label="要求"></el-table-column>
						<el-table-column prop="status" label="状态" width="60">
							<template slot-scope="{ row, $index }">
								<span class="text-warning" v-if="row.status == '10'">待分配</span>
								<span class="text-primary" v-if="row.status == '20'">已分配</span>
								<span class="text-primary" v-if="row.status == '30'">已确认</span>
								<span class="text-warning" v-if="row.status == '40'">已签到</span>
								<span class="text-success" v-if="row.status == '50'">已完成</span>
								<span class="text-danger" v-if="row.status == '60'">已撤回</span>
								<span class="text-gray" v-if="row.status == '70'">已取消</span>
							</template>
						</el-table-column>
						<!-- 异常状态动态显示 -->
						<!-- <el-table-column prop="abnormal_type_name" label="异常状态" width="80"></el-table-column> -->
						<el-table-column prop="" label="异常状态" width="80">
							<template slot-scope="{ row, $index }">
								<div v-if="status != 100">
									<div class="pointer" v-if="row.abnormal.length != 0" @click="tagstate(100, row.task_sn)">
										<div v-for="(item, index) in row.abnormal" :key="index">
											<span>{{ item }}</span>
										</div>
									</div>
									<div v-if="row.abnormal.length == 0"></div>
								</div>
								<div v-if="status == 100">
									<span>{{ row.abnormal_type_name }}</span>
								</div>
							</template>
						</el-table-column>
						<el-table-column prop="hour_delay" label="延时T" min-width="60" align="center"></el-table-column>
						<!-- <el-table-column label="操作" width="130" fixed="right" v-if="status!=70"> -->
						<el-table-column label="操作" :width="status != 70 ? 150 : 50" fixed="right">
							<template slot-scope="{ row, $index }">
								<el-link :underline="false" type="primary" v-if="status == 100" @click="handle(row, $index)"
									>处理</el-link
								>
								<el-link
									:underline="false"
									type="danger"
									v-if="status == 20 || status == 30 || status == 40 || status == 50"
									@click="withdraw(row, $index)"
									>撤回</el-link
								>
								<el-link
									:underline="false"
									type="info"
									v-if="status != 70 && status != 100 && status != 10"
									@click="editBtn(row, $index)"
									>修改</el-link
								>
								<el-link
									:underline="false"
									type="danger"
									v-if="status != 70 && status != 100"
									@click="redactBtn(row, $index)"
									>取消</el-link
								>
							</template>
						</el-table-column>
					</el-table>
				</template>
			</div>

			<!-- 下面部分 -->
			<div class="pt_20 px_10">
				<el-col :span="2">
					<el-button type="default" @click="downloadOrder()" round size="mini">导出</el-button>
				</el-col>
				<el-form :inline="true" :model="ruleForm" class="form-inline" @keyup.enter.native="shearchBtn2()">
					<div class="next_top">
						<el-form-item
							><el-input size="mini" class="w_80" v-model="next_name" placeholder="姓名"></el-input
						></el-form-item>
						<el-form-item
							><el-input size="mini" class="w_110" v-model="next_mobile" placeholder="手机号"></el-input
						></el-form-item>

						<el-form-item>
							<el-date-picker
								size="mini"
								class="w_90i"
								v-model="next_date"
								type="date"
								value-format="yyyy-MM-dd"
								format="MM-dd"
								placeholder="选择日期"
								:disabled="next_date_disabled"
							></el-date-picker>
						</el-form-item>

						<el-form-item>
							<el-select
								size="mini"
								class="w_120"
								v-model="next_area_arr"
								placeholder="商圈"
								@change="changeBtndialogarea_next"
								:disabled="next_area_arr_disabled"
							>
								<el-option
									v-for="item in areaList"
									:key="item.id"
									:label="item.area_name"
									:value="`${item.id}|${item.area_name}`"
								></el-option>
							</el-select>
						</el-form-item>
						<el-form-item>
							<el-select
								size="mini"
								class="w_110"
								v-model="next_type_arr"
								placeholder="岗位"
								@change="changeBtndialogtype_next"
								:disabled="next_type_arr_disabled"
							>
								<el-option
									v-for="item in TypeArr"
									:key="item.id"
									:label="item.label_name"
									:value="`${item.id}|${item.label_name}`"
								></el-option>
							</el-select>
						</el-form-item>

						<!-- <el-form-item>
                        <el-input size="mini" class="w_50" placeholder="时段" disabled></el-input>
                    </el-form-item> -->

						<el-form-item>
							<el-time-select
								class="w_80i"
								v-model="onStreamTimeStart"
								:picker-options="{ start: '00:00', step: '00:30', end: '23:30' }"
								placeholder="开始"
								:disabled="onStreamTimeStart_disabled"
							>
							</el-time-select>
						</el-form-item>

						<el-form-item>
							<el-time-select
								class="w_80i"
								v-model="onStreamTimeEnd"
								:picker-options="{ start: '00:00', step: '00:30', end: '23:30' }"
								placeholder="结束"
								:disabled="onStreamTimeEnd_disabled"
							>
							</el-time-select>
						</el-form-item>

						<el-form-item>
							<!-- <el-select size="mini" class="w_60" v-model="next_sex" placeholder="性别" :disabled="next_sex_disabled"> -->
							<el-select size="mini" class="w_60" v-model="next_sex" placeholder="性别">
								<el-option label="不限" value=""></el-option>
								<el-option label="男" value="male"></el-option>
								<el-option label="女" value="female"></el-option>
							</el-select>
						</el-form-item>

						<!-- <el-form-item><el-input size="mini" class="w_70" v-model="next_start" :disabled="next_start_disabled" placeholder="最小年龄"></el-input></el-form-item> -->
						<el-form-item
							><el-input size="mini" class="w_50" v-model="next_start" placeholder="最小"></el-input
						></el-form-item>
						<el-form-item>~</el-form-item>
						<!-- <el-form-item><el-input size="mini" class="w_70" v-model="next_next" :disabled="next_next_disabled" placeholder="最大年龄"></el-input></el-form-item> -->
						<el-form-item
							><el-input size="mini" class="w_70" v-model="next_next" placeholder="最大年龄"></el-input
						></el-form-item>

						<el-button size="mini" type="primary" class="round-right" @click="shearchBtn2" native-type="button"
							>搜索</el-button
						>
						<el-button size="mini" round @click="resetBtn2">重置</el-button>
					</div>

					<div class="next_button">
						<el-button size="mini" :type="recommend_tag == 1 ? 'primary' : 'default'" round @click="recommend(1)"
							>全部</el-button
						>
						<el-button size="mini" :type="recommend_tag == 2 ? 'success' : 'default'" round @click="recommend(2)"
							>推荐</el-button
						>
						<el-button size="mini" :type="recommend_tag == 3 ? 'success' : 'default'" round @click="recommend2()"
							>报名</el-button
						>
					</div>
				</el-form>
			</div>

			<div class="tableMaxBox">
				<template>
					<!-- 表格部分 -->
					<el-table :data="centerLists" stripe>
						<el-table-column prop="id" label="序号" width="60" align="center">
							<template slot-scope="{ row, $index }">
								<span>{{ $index + 1 }}</span>
							</template>
						</el-table-column>
						<!-- <el-table-column prop="staff_sn" label="人才编号" width="100">
                            <template slot-scope="{row,$index}">
                                <span>{{row.staff_sn}}</span>
                            </template>
                        </el-table-column> -->
						<el-table-column prop="name" label="姓名" width="110">
							<template slot-scope="{ row, $index }">
								<el-tooltip effect="light" placement="top" :open-delay="500">
									<div class="wrap_show" slot="content">
										<div>
											<img :src="user_history.avatar" alt="头像" />
											<el-rate
												v-model="user_history.level"
												:colors="colors"
												disabled
												style="margin-top: 10px;"
											></el-rate>
										</div>
										<div>
											<div class="show_line">
												<div style="width: 110px; text-align: right;">平台服务经历：</div>
												<div v-if="user_history.service_history.length != 0">
													<div v-for="(item, index) in user_history.service_history" :key="index">
														<span v-if="item.is_this == false" style="display: inline-block; width: 130px;">{{
															item.shop_name
														}}</span>
														<span
															v-if="item.is_this == true"
															style="display: inline-block; width: 130px; color: var(--orange1);"
															>{{ item.shop_name }}</span
														>
														<span v-if="item.is_this == false">{{ item.task_num }}次</span>
														<span v-if="item.is_this == true" style="color: var(--orange1);"
															>{{ item.task_num }}次</span
														>
													</div>
												</div>
												<div v-if="user_history.service_history.length == 0">
													无
												</div>
											</div>
											<div class="show_line">
												<div style="width: 110px; text-align: right;">工作经历：</div>
												<div v-if="user_history.task_history.length != 0">
													<div v-for="(item, index) in user_history.task_history" :key="index">
														<span>{{ item.start_time }}至{{ item.end_time }}</span>
														<span>{{ item.enterprise_name }}</span>
														<span>{{ item.position }}</span>
													</div>
												</div>
												<div v-if="user_history.task_history.length == 0">
													无
												</div>
											</div>
											<div class="show_line">
												<div style="width: 110px; text-align: right;">学历：</div>
												<div v-if="user_history.education != ''">
													<div>
														<span>{{ user_history.education }}</span>
													</div>
												</div>
												<div v-if="user_history.education == ''">
													<div>
														<span>无</span>
													</div>
												</div>
											</div>
											<div class="show_line">
												<div style="width: 110px; text-align: right;">常驻地址：</div>
												<div v-if="user_history.address != ''">
													<div>
														<span>{{ user_history.address }}&nbsp;{{ user_history.detailed_address }}</span>
													</div>
												</div>
												<div v-if="user_history.address == ''">
													<div>
														<span>无</span>
													</div>
												</div>
											</div>
										</div>
									</div>
									<div>
										<span
											class="pointer u text-primary"
											@mouseover="cellMouseEnter(row)"
											@mouseout="cellMouseLeave"
											@click="toPersonnelListHx(row)"
											>{{ row.name }}</span
										>
										<span
											v-if="row.newPeople == 1"
											style="background: #c93a32; color: #fff; padding: 2px 3px; border-radius: 3px;"
											>新</span
										>
										<span
											v-if="row.is_hui == 1"
											style="background: #c93a32; color: #fff; padding: 2px 3px; border-radius: 3px;"
											>回</span
										>
									</div>
								</el-tooltip>
							</template>
						</el-table-column>
						<el-table-column prop="mobile" label="电话" width="100"></el-table-column>
						<el-table-column prop="level" label="星级" width="60" align="center"></el-table-column>
						<el-table-column prop="gender" label="性别" width="60" align="center">
							<template slot-scope="{ row, $index }">
								<span v-if="row.gender == 'male'">男</span>
								<span v-if="row.gender == 'female'">女</span>
								<span v-if="row.gender == 'other'">未知</span>
							</template>
						</el-table-column>
						<el-table-column prop="age" label="年龄" width="100" align="center"></el-table-column>
						<el-table-column prop="job_types" label="岗位" width="140" align="center">
							<template slot-scope="{ row, $index }">
								<span :title="row.job_types">{{ row.job_types }}</span>
							</template>
						</el-table-column>
						<el-table-column label="健康证" align="center" width="75px">
							<template slot-scope="{ row, $index }">
								<span class="text-success" v-if="row.certificate_health_status == '1'">有</span>
								<span class="text-danger" v-if="row.certificate_health_status == '2'">无</span>
							</template>
						</el-table-column>
						<el-table-column prop="work_date" label="日期" width="120" align="center">
							<template slot-scope="{ row, $index }">
								<span>{{ next_date2 }}</span>
							</template>
						</el-table-column>
						<el-table-column label="报名状态" align="center" width="75px">
							<template slot-scope="{ row, $index }">
								<div v-if="next_task_sn == ''">
									<span>/</span>
								</div>
								<div v-if="next_task_sn != ''">
									<span class="text-success" v-if="row.is_appointment == '1'">已报名</span>
									<span class="text-danger" v-if="row.is_appointment == '2'">未报名</span>
								</div>
							</template>
						</el-table-column>
						<!-- <el-table-column prop="gender" label="报名状态" width="60" align="center">
                            <template slot-scope="{row,$index}">
                                <span v-if="row.gender=='male'">已报名</span>
                                <span v-if="row.gender=='female'">未报名</span>
                            </template>
                        </el-table-column> -->
						<el-table-column prop="is_set" label="设置类别" width="100" align="center">
							<template slot-scope="{ row, $index }">
								<span v-if="row.is_set == 1" class="text-success">日程确认</span>
								<span v-if="row.is_set == 2">接活设置</span>
							</template>
						</el-table-column>
						<el-table-column prop="task_sum" label="近30天服务次数" width="80" align="center">
							<template slot-scope="{ row, $index }">
								<span>{{ row.task_sum }}</span>
							</template>
						</el-table-column>
						<el-table-column prop="task_num" label="任务" width="60" align="center">
							<template slot-scope="{ row, $index }">
								<el-tooltip effect="dark" placement="top" :open-delay="500" v-if="row.taskinfo.length != 0">
									<div slot="content">
										<div v-for="(item, index) in row.taskinfo" :key="index" style="margin-bottom: 10px;">
											<span class="mr_10 mb_10">{{ item.shop_name }}：</span>
											<span class="mr_10 mb_10">{{ item.start_time }}-{{ item.end_time }}</span>
										</div>
									</div>
									<div>
										<!-- 点击跳转任务列表，携带人的名字过去 -->
										<h4 style="cursor: pointer;" @click="toTasklist(row)">{{ row.task_num }}</h4>
									</div>
								</el-tooltip>
								<div v-if="row.taskinfo.length == 0">
									<!-- 点击跳转任务列表，携带人的名字过去 -->
									<h4 style="cursor: pointer;" @click="toTasklist(row)">{{ row.task_num }}</h4>
								</div>
							</template>
						</el-table-column>
						<el-table-column prop="task_hours" label="已分配时长" width="60" align="center">
							<template slot-scope="{ row, $index }">
								<el-tooltip effect="dark" placement="top" :open-delay="500" v-if="row.taskinfo.length != 0">
									<div slot="content">
										<div v-for="(item, index) in row.taskinfo" :key="index" style="margin-bottom: 10px;">
											<span class="mr_10 mb_10">{{ item.shop_name }}：</span>
											<span class="mr_10 mb_10">{{ item.start_time }}-{{ item.end_time }}</span>
										</div>
									</div>
									<div>
										<!-- 点击跳转任务列表，携带人的名字过去 -->
										<h4 style="cursor: pointer;" @click="toTasklist(row)">{{ row.task_hours }}h</h4>
									</div>
								</el-tooltip>
								<div v-if="row.taskinfo.length == 0">
									<!-- 点击跳转任务列表，携带人的名字过去 -->
									<h4 style="cursor: pointer;" @click="toTasklist(row)">{{ row.task_hours }}h</h4>
								</div>
							</template>
						</el-table-column>
						<el-table-column prop="task_hours" label="空闲时长" width="60" align="center">
							<template slot-scope="{ row, $index }">
								<div>
									<h4 style="cursor: pointer;">{{ row.free_hours }}h</h4>
								</div>
							</template>
						</el-table-column>
						<el-table-column prop="intersection_time" label="空闲时段" width="120">
							<template slot-scope="{ row, $index }">
								<el-tooltip effect="dark" placement="top" :open-delay="500">
									<div slot="content">
										<div v-for="(item, index) in user_historySD" :key="index">
											<span class="mr_10 mb_10">{{ item.week }}</span>
											<span class="mr_10 mb_10" v-for="(itemarr, indexss) in item.free_time" :key="indexss"
												>{{ itemarr[0] }}-{{ itemarr[1] }}</span
											>
											<span class="mb_10" v-if="item.is_set == 1">日程</span>
											<span class="mb_10" v-if="item.is_set == 2">偏好</span>
										</div>
									</div>

									<div @mouseover="cellMouseEnterSD(row)" @mouseout="cellMouseEnterSDLeave">
										<div v-if="row.intersection_time.length != 0">
											<!-- <h4 v-for="(items,indexs) in row.intersection_time" :key="indexs">{{items.start | dateshear}}-{{items.end | dateshear}}</h4> -->
											<h4 style="cursor: pointer;" v-for="(items, indexs) in row.intersection_time" :key="indexs">
												{{ items.start }}-{{ items.end }}
											</h4>
										</div>
										<div v-if="row.intersection_time.length == 0">
											<h4 style="cursor: pointer;">全天休息</h4>
										</div>
									</div>
								</el-tooltip>
							</template>
						</el-table-column>
						<el-table-column prop="area_name" label="推荐原因" min-width="120">
							<template slot-scope="{ row, $index }">
								<el-tooltip effect="dark" placement="top" v-if="row.score_infos[0].text != ''">
									<div slot="content">
										<span class="tooltip" v-for="(item, index) in row.score_infos" :key="index">{{ item.text }}</span>
									</div>
									<span style="cursor: pointer;">{{ row.score_sum }}</span>
								</el-tooltip>
								<div v-if="row.score_infos[0].text == ''">
									<span style="cursor: pointer;">{{ row.score_sum }}</span>
								</div>
							</template>
						</el-table-column>
						<el-table-column label="操作" width="130" fixed="right" align="center">
							<template slot-scope="{ row, $index }">
								<el-button type="success" round size="mini" @click="fenpeiBtn(row, $index)">分配</el-button>
							</template>
						</el-table-column>
					</el-table>
					<!-- 分页组件 -->
					<page :total="total2" :pageNums="pageNum2" @pagedata="onChildValue2" class="mt_20"></page>
				</template>
			</div>
		</div>

		<!-- 任务取消 -->
		<el-dialog
			:title="diaTitle"
			:visible.sync="StateShowStop"
			width="560"
			:close-on-click-modal="false"
			@close="hiddenRY"
		>
			<div class="auditCentent">
				<div class="row-info clear">
					<div class="fl title-key"><i class="lhadmin"></i><span>责任方：</span></div>
					<div class="fl list-cont">
						<el-select v-model="cancel.zrf" placeholder="请选择">
							<el-option v-for="(item, index) in all_revoke.cancel" :key="index" :label="item.name" :value="index">{{
								item.name
							}}</el-option>
						</el-select>
					</div>
				</div>
				<div class="row-info clear">
					<div class="fl title-key"><i class="lhadmin"></i><span>类型：</span></div>
					<div class="fl list-cont">
						<el-select v-model="cancel.type" placeholder="请选择">
							<el-option v-for="(item, index) in cancel_type" :key="index" :label="item.name" :value="index">{{
								item.name
							}}</el-option>
						</el-select>
					</div>
				</div>
				<div class="row-info clear">
					<div class="fl title-key"><i class="lhadmin"></i><span>原因：</span></div>
					<div class="fl list-cont">
						<el-select v-model="cancel.reason" placeholder="请选择">
							<el-option v-for="item in cancel_reason" :key="item.id" :label="item.title" :value="item.id"></el-option>
						</el-select>
					</div>
				</div>
				<div class="row-info clear">
					<div class="fl title-key"><i class="lhadmin"></i><span>备注：</span></div>
					<div class="fl list-cont">
						<el-input type="textarea" :rows="8" :cols="44" placeholder="" v-model="cancel.bz"></el-input>
					</div>
				</div>
			</div>
			<div slot="footer" class="dialog-footer">
				<span class="btnOK mr_20" @click="addMenuBtn()">确 定</span>
				<span class="resetBtn" @click="hiddenRY">取 消</span>
			</div>
		</el-dialog>
		<!-- 任务撤销 -->
		<el-dialog
			:title="diaTitle"
			:visible.sync="StateShowcx"
			width="560"
			:close-on-click-modal="false"
			@close="hiddenRY"
		>
			<div class="auditCentent">
				<div class="row-info clear">
					<div class="fl title-key"><i class="lhadmin"></i><span>责任方：</span></div>
					<div class="fl list-cont">
						<el-select v-model="revoke.zrf" placeholder="请选择">
							<el-option v-for="(item, index) in all_revoke.withdraw" :key="index" :label="item.name" :value="index">{{
								item.name
							}}</el-option>
						</el-select>
					</div>
				</div>
				<div class="row-info clear">
					<div class="fl title-key"><i class="lhadmin"></i><span>类型：</span></div>
					<div class="fl list-cont">
						<el-select v-model="revoke.type" placeholder="请选择">
							<el-option v-for="(item, index) in revoke_type" :key="index" :label="item.name" :value="index">{{
								item.name
							}}</el-option>
						</el-select>
					</div>
				</div>
				<div class="row-info clear">
					<div class="fl title-key"><i class="lhadmin"></i><span>原因：</span></div>
					<div class="fl list-cont">
						<el-select v-model="revoke.reason" placeholder="请选择">
							<el-option v-for="item in revoke_reason" :key="item.id" :label="item.title" :value="item.id"></el-option>
						</el-select>
					</div>
				</div>
				<div class="row-info clear">
					<div class="fl title-key"><i class="lhadmin"></i><span>备注：</span></div>
					<div class="fl list-cont">
						<el-input type="textarea" :rows="8" :cols="44" placeholder="" v-model="revoke.bz"></el-input>
					</div>
				</div>
			</div>
			<div slot="footer" class="dialog-footer">
				<span class="btnOK mr_20" @click="addCxBtn()">确 定</span>
				<span class="resetBtn" @click="hiddenRY">取 消</span>
			</div>
		</el-dialog>
		<el-dialog :title="diaTitle" :visible.sync="FPShowStop" width="560px" :close-on-click-modal="false">
			<div class="auditCentent">
				<span>确认要分配给该员工吗？</span>
			</div>
			<div slot="footer" class="dialog-footer">
				<span class="btnOK mr_20" @click="next()">确 定</span>
				<span class="resetBtn" @click="hiddenRY">取 消</span>
			</div>
		</el-dialog>
		<!-- 第二次弹框 -->
		<el-dialog :title="diaTitle" :visible.sync="NextShow" width="560" :close-on-click-modal="false">
			<div class="auditCentent">
				<el-table :data="demandInfowhere" stripe @selection-change="handleSelectionSelect">
					<el-table-column type="selection"></el-table-column>
					<el-table-column prop="sn" label="任务编号" width="150px">
						<template slot-scope="{ row, $index }">
							<span class="u text-primary">{{ row.sn }}</span>
						</template>
					</el-table-column>
					<el-table-column prop="job_name" label="任务名称" width="90px">
						<template slot-scope="{ row, $index }">
							<span class="u text-primary">{{ row.job_name }}&nbsp;&nbsp;{{ row.hour_expect }}h</span>
						</template>
					</el-table-column>
					<el-table-column prop="start_time" label="任务开始/结束时间">
						<template slot-scope="{ row, $index }">
							<span>{{ row.start_time }} - {{ row.end_time }}</span>
						</template>
					</el-table-column>
				</el-table>
			</div>
			<div slot="footer" class="dialog-footer">
				<span class="btnOK mr_20" @click="distribution()">是</span>
				<span class="resetBtn" @click="NextShow = false">否</span>
			</div>
		</el-dialog>
		<!-- 修改任务-弹框 -->
		<el-dialog :title="diaTitle" :visible.sync="TaskEdit" width="600px" :close-on-click-modal="false">
			<div class="auditCentent">
				<div class="row-info clear">
					<div class="fl title-key">任务编号</div>
					<div class="fl list-cont bb">
						<el-input v-model="edit_task_sn" disabled></el-input>
					</div>
				</div>
				<div class="row-info clear">
					<div class="fl title-key">任务开始</div>
					<div class="fl list-cont bb">
						<el-input v-model="edit_time1" disabled></el-input>
					</div>
				</div>
				<div class="row-info clear">
					<div class="fl title-key">结束时间</div>
					<div class="fl list-cont bb">
						<el-input v-model="edit_time2" disabled></el-input>
					</div>
				</div>
				<div class="row-info clear">
					<div class="fl title-key">计划时长</div>
					<div class="fl list-cont b_sj">
						<el-input v-model="edit_date" placeholder disabled></el-input>
					</div>
					<div class="fl title-key" style="width: 50px; text-align: left; margin-left: 10px;">h</div>
				</div>
				<div class="row-info clear">
					<div class="fl title-key">签到时间</div>
					<div class="fl list-cont bb">
						<el-date-picker
							v-model="edit_checkin_time"
							type="datetime"
							value-format="yyyy-MM-dd HH:mm:ss"
							placeholder=""
							:disabled="edit_static == 20 || edit_static == 30"
							@change="edit_checkin_time_change()"
						></el-date-picker>
					</div>
				</div>
				<!-- <div class="row-info clear">
					<div class="fl title-key">延时时长</div>

					<div class="fl list-cont b_sj">
						<el-input
							v-model="edit_hour_delay"
							placeholder
							:disabled="this.edit_static == 50 ? true : false"
						></el-input>
					</div>
					<div class="fl title-key" style="width: 50px; text-align: left; margin-left: 10px;">h</div>
				</div> -->
				<div class="row-info clear">
					<div class="fl title-key">完成时间</div>
					<div class="fl list-cont bb">
						<el-date-picker
							v-model="edit_finish_time"
							type="datetime"
							value-format="yyyy-MM-dd HH:mm:ss"
							placeholder=""
							:disabled="this.edit_static == 50 ? false : true"
							@change="edit_finish_time_change()"
						></el-date-picker>
					</div>
				</div>
				<div class="row-info clear">
					<div class="fl title-key">实际时长</div>

					<div class="fl list-cont b_sj">
						<el-input v-model="edit_hour_actual" placeholder disabled></el-input>
					</div>
					<div class="fl title-key" style="width: 50px; text-align: left; margin-left: 10px;">h</div>
				</div>
				<div class="row-info clear">
					<div class="fl title-key">价格</div>
					<div class="fl list-cont b_sj">
						<el-input v-model="amout_shop" placeholder></el-input>
					</div>
					<div class="fl title-key" style="width: 50px; text-align: left; margin-left: 10px;">元/小时</div>
				</div>
				<div class="row-info clear" v-if="edit_static2 != 50">
					<div class="fl title-key">状态</div>

					<div class="fl list-cont b">
						<!-- 待分配 -->
						<el-select v-model="edit_static" v-if="edit_static2 == 10" placeholder="请选择" @change="abelEadit">
							<el-option label="待分配" value="10">待分配</el-option>
							<!-- <el-option label="已完成" value="50">已完成</el-option> -->
						</el-select>
						<!-- 已分配 -->
						<el-select v-model="edit_static" v-if="edit_static2 == 20" placeholder="请选择" @change="abelEadit">
							<el-option label="已分配" value="20">已分配</el-option>
							<!-- <el-option label="已完成" value="50">已完成</el-option> -->
						</el-select>
						<!-- 已确认 -->
						<el-select v-model="edit_static" v-if="edit_static2 == 30" placeholder="请选择" @change="abelEadit">
							<el-option label="已确认" value="30">已确认</el-option>
							<!-- <el-option label="已完成" value="50">已完成</el-option> -->
						</el-select>
						<!-- 已签到 -->
						<el-select v-model="edit_static" v-if="edit_static2 == 40" placeholder="请选择" @change="abelEadit">
							<el-option label="已签到" value="40">已签到</el-option>
							<!-- <el-option label="已完成" value="50">已完成</el-option> -->
						</el-select>
						<!-- 已完成 -->
						<!-- <el-select v-model="edit_static" v-if="edit_static2 == 50" placeholder="请选择">
							<el-option label="已完成" value="50">已完成</el-option>
						</el-select> -->
						<!-- 已撤回 -->
						<el-select v-model="edit_static" v-if="edit_static2 == 60" placeholder="请选择" @change="abelEadit">
							<el-option label="已撤回" value="60">已撤回</el-option>
							<!-- <el-option label="已完成" value="50">已完成</el-option> -->
						</el-select>
					</div>
				</div>
			</div>
			<div slot="footer" class="dialog-footer">
				<span class="btnOK mr_20" @click="taskBtnEdit()">确 定</span>
				<span class="resetBtn" @click="hiddenRY">取 消</span>
			</div>
		</el-dialog>
		<el-dialog :title="diaTitle" :visible.sync="StateShowhandle" width="560" :close-on-click-modal="false">
			<div class="auditCentent">
				<span>该异常确认已处理了吗?</span>
			</div>
			<div slot="footer" class="dialog-footer">
				<span class="btnOK mr_20" @click="handlenext()">确 定</span>
				<span class="resetBtn" @click="hiddenRY">取 消</span>
			</div>
		</el-dialog>
		<el-dialog title="分配提示" :visible.sync="AssignmentTips" width="560px" :close-on-click-modal="false">
			<div class="auditCentent">
				<span>以下原因系统认为分配不合理，确定要继续分配吗?</span>
				<div style="margin-top: 20px;">
					<p v-for="(item, index) in AssignmentTips_reason" :key="index">{{ item }}</p>
				</div>
			</div>
			<div slot="footer" class="dialog-footer">
				<span
					class="btnOK mr_20"
					@click="assign(multipleSelectionSelect.toString())"
					v-if="multipleSelectionSelect != 0"
					>确 定</span
				>
				<span class="btnOK mr_20" @click="assign(multipleSelection.toString())" v-if="multipleSelectionSelect == 0"
					>确 定</span
				>
				<span class="resetBtn" @click="hiddenRY">取 消</span>
			</div>
		</el-dialog>
	</div>
</template>

<script>
var common = require('../../../static/tool.js')
import { mainfun } from '../../../assets/js/main.js'
import { publicData } from '../../../assets/js/data.js'
export default {
	name: 'ShopList',
	data() {
		return {
			id: '',
			dataMes: '',
			ids: '',
			sn: '',
			recommend_tag: 1,
			ids_name: '',
			fp_staff_id: '', //全景调度centerList的员工id
			fp_staff_name: '', //全景调度centerList的员工名称
			fp_staff_sn: '', //全景调度centerList的员工SN
			agreement: '',
			index: '10',
			windowSizeHeight: document.documentElement.clientHeight, //浏览器可视化窗口的大小
			screenHeight: document.documentElement.clientHeight,
			manageInfo: JSON.parse(sessionStorage.getItem('manageInfo')), //登录信息
			url: common.url,
			head_url: common.head_url,
			abnormalshow: false, //控制异常状态的显示与隐藏
			//搜索对应值
			task_sn: '', //任务编号
			demand_sn: '', //订单编号
			staff_name: '', //接单人
			mobile: '', //手机号
			area_arr: '', //商圈信息
			area_id: '',
			area_name: '',
			s_time_slot: '',
			s_departmentIds: [],
			s_departmentNames: [],
			type_arr: '', //需求信息
			label_id: '',
			label_name: '',
			shop_id: '', //店铺id
			shop_name: '', //店铺名
			next_shop_sn: '', //店铺sn
			status: 10, //账号状态： 1:正常  2:禁用
			time_type: '2', //时间类型选择
			ruleForm: {
				date1: '', //开始时间
				date2: '' //结束时间
			},

			TypeArr: '',
			demandList: [], //任务列表
			centerLists: [], //全景调度列表
			statistic: {
				abnormal: '', //异常
				assigning: '', //待分配（待确认+已撤销）
				withdraw: '', //已撤销
				assigned: '', //待确认
				accept: '', //待签到
				checkin: '', //进行中
				cancel: '', //已取消
				finish: '' //已完成
			}, //任务统计条数
			//向分页组件传值
			total: 0,
			pageNum: '',
			pageSizeNow: '',
			total2: 0,
			pageNum2: '',
			pageSizeNow2: '',
			// 审核状态
			text: '',
			merchantsList: [], //商户列表
			areaList: [], //区域列表
			shopList: [], //店铺列表
			diaTitle: '', //弹框title
			StateShowStart: false,
			StateShowStop: false,
			FPShowStop: false,
			StateShowcx: false,
			NextShow: false,
			TaskEdit: false,
			StateShowhandle: false,
			AssignmentTips: false,
			AssignmentTips_reason: [], //强制对应文字
			multipleSelection: '',
			//任务修改
			actual_end_time: '', //计费完成时间
			edit_task_sn: '',
			edit_time1: '',
			edit_time2: '',
			edit_date: '',
			edit_checkin_time: '',
			actual_start_time: '', //计费开始时间
			actual_start_time2: '',
			edit_hour_delay: '',
			edit_finish_time: '',
			edit_finish_time2: '',
			edit_hour_actual: '',
			edit_price: '',
			edit_static: '',
			edit_static2: '', //任务详情的值
			amout_shop: '',
			// 底部搜索
			next_task_sn: '', //任务id
			next_task_sn2: '', //任务id
			next_name: '',
			next_mobile: '',
			next_date: '',
			next_date2: '',
			onStreamTimeStart: '',
			onStreamTimeEnd: '',
			next_type_arr: '',
			next_label_id: '',
			next_label_name: '',
			next_sex: '',
			next_start: '',
			next_next: '',
			next_area_arr: '', //商圈信息
			next_area_id: '',
			next_area_name: '',
			//点击异常。顶部搜索的部分操作框变灰
			task_sn_disabled: false, //任务编号
			demand_sn_disabled: false, //订单编号
			staff_name_disabled: false, //接单人
			mobile_disabled: false, //手机号
			shop_name_disabled: false, //店铺名称

			//推荐按钮点击，底部搜索的部分操作框变灰
			next_date_disabled: false, //选择时间
			onStreamTimeStart_disabled: false, //选择时间
			onStreamTimeEnd_disabled: false, //选择时间
			next_area_arr_disabled: false, //商圈
			next_type_arr_disabled: false, //选择岗位
			next_sex_disabled: false, //选择性别
			next_start_disabled: false, //最小年龄
			next_next_disabled: false, //最大年龄

			//点击分配，二次弹框
			demandInfowhere: '',
			multipleSelectionSelect: [], //选中的序号集合

			all_revoke: [],
			//撤销相关
			revoke: {
				zrf: '',
				type: '',
				reason: '',
				bz: ''
			},
			revoke_type: [], //撤销类型列表
			revoke_reason: [], //撤销原因列表

			//取消相关
			cancel: {
				zrf: '',
				type: '',
				reason: '',
				bz: ''
			},
			cancel_type: [], //取消类型列表
			cancel_reason: [], //取消原因列表
			user_history: {
				avatar: '',
				education: '无',
				level: 0,
				service_history: [],
				task_history: [],
				address: '',
				detailed_address: ''
			}, //请求人员资料信息
			user_historySD: [], //请求空闲时段信息
			// 颜色设定
			colors: ['#cf2e22', '#cf2e22', '#cf2e22'],
			mouseoverdata: '',
			mouseoverdataSD: '',
			// 是否报名
			is_appointment: '',
			start_date_save: '', //时间保持
			abnormal_task_sn: '', //跳转异常列表
			areaStatus: true
		}
	},
	computed: {
		//撤销相关
		poke_zrf() {
			return this.revoke.zrf.toString()
		},
		//撤销相关
		poke_type() {
			return this.revoke.type.toString()
		},
		//取消相关
		cancels_zrf() {
			return this.cancel.zrf.toString()
		},
		//取消相关
		cancels_type() {
			return this.cancel.type.toString()
		}
	},
	watch: {
		// // edit_hour_actual 实际时长的计算
		// //不是已完成状态：实际时长=完成时间-计费开始时间，签到时间如果改变，就把签到时间的值赋予计费开始时间
		// //已完成状态：实际时长=计费完成时间（actual_end_time）-计费开始时间，签到时间如果改变，就把签到时间的值赋予计费开始时间
		// edit_checkin_time(val,old){  //签到时间改变
		//     //任务开始时间，签到时间
		//     // if(old!=""){
		//         //开始时间为空，直接赋值
		//         if(this.actual_start_time2=='0000-00-00 00:00:00'){
		//             this.actual_start_time = val;//直接赋值于计费开始时间
		//         }else{
		//             //签到时间-任务开始时间>5的时候，则赋值
		//             var cha = this.time_dis(this.actual_start_time2,val);
		//             if(cha>5){
		//                 this.actual_start_time = val;//赋值于计费开始时间
		//             }
		//         }
		//     // }
		//     this.difference(this.actual_start_time,this.actual_end_time);

		// },
		// edit_finish_time(val,old){  //完成时间改变
		//     //任务开始时间，签到时间
		//     // if(old!=""){
		//         this.actual_end_time = val;//赋值于计费完成时间
		//     // }
		//     this.difference(this.actual_start_time,this.actual_end_time);
		// },
		//撤销-责任方改变
		poke_zrf(newValue, oldValue) {
			if (newValue != '') {
				this.revoke.type = '' //类型清空
				this.revoke.reason = '' //原因清空
				this.revoke_type = [] //撤销类型列表清空
				this.revoke_reason = [] //撤销原因列表清空
				this.revoke_type = this.all_revoke.withdraw[newValue].child
			} else {
				this.revoke.type = '' //类型清空
				this.revoke.reason = '' //原因清空
				this.revoke_type = [] //撤销类型列表清空
				this.revoke_reason = [] //撤销原因列表清空
				this.revoke_type = []
			}
		},
		//撤销-类型改变
		poke_type(newValue, oldValue) {
			if (newValue != '') {
				this.revoke.reason = '' //原因清空
				this.revoke_reason = this.revoke_type[newValue].child
			} else {
				this.revoke.reason = '' //原因清空
				this.revoke_reason = []
			}
		},
		//取消-责任方改变
		cancels_zrf(newValue, oldValue) {
			console.log('===', newValue)
			if (newValue != '') {
				this.cancel.type = '' //类型清空
				this.cancel.reason = '' //原因清空
				this.cancel_type = [] //取消类型列表清空
				this.cancel_reason = [] //取消原因列表清空
				this.cancel_type = this.all_revoke.cancel[newValue].child
			} else {
				this.cancel.type = '' //类型清空
				this.cancel.reason = '' //原因清空
				this.cancel_type = [] //取消类型列表清空
				this.cancel_reason = [] //取消原因列表清空
				this.cancel_type = []
			}
		},
		//取消-类型改变
		cancels_type(newValue, oldValue) {
			console.log('===', newValue)
			if (newValue != '') {
				this.cancel.reason = '' //原因清空
				this.cancel_reason = this.cancel_type[newValue].child
			} else {
				this.cancel.reason = '' //原因清空
				this.cancel_reason = []
			}
		},
		//商圈改变
		areaList(newValue, oldValue) {
			if (oldValue == '') {
				//上面的列表数据
				if (this.status == 100) {
					this.listAbnormal()
				} else {
					this.listShop()
				}

				//下面的列表数据
				this.next_area_arr = this.areaList[0].id + '|' + this.areaList[0].area_name
				this.next_area_id = this.areaList[0].id
				this.next_area_name = this.areaList[0].area_name
				this.getcenterList()
			}
		}
	},
	created() {
		//获取商圈列表
		this.listArea()

		//取消和撤销原因接口
		let fn = new FormData()
		this.$http.post(this.url + '/reason/reasonList', fn).then(
			res => {
				if (res.data.msg == '查询成功！' || res.data.code == '200') {
					this.all_revoke = res.data.data
				} else if (res.data.code == '8886') {
					//code   8886  登录过期
					sessionStorage.clear()
					this.$alert('登录已过期，请重新登录 !', '提示', {
						confirmButtonText: '确定',
						callback: action => {
							window.location = 'login.html'
						}
					})
					return
				} else {
					this.$message.error(res.data.msg)
					return
				}
			},
			res => {
				this.$message.error('网络错误！')
				return
			}
		)
		if (this.$route.query.id) {
			this.id = this.$route.query.id //接收传参
			this.business_id = this.id
		}
		if (!sessionStorage.getItem('manageInfo')) {
			// 判断是否登录
			window.location = 'login.html'
			return
		}

		var d = this.date(0)
		this.ruleForm.date1 = d + ' 00:00:00'
		var e = this.date(1)
		this.ruleForm.date2 = e + ' 23:59:00'

		var TimeCache10 = {
			date1: this.ruleForm.date1,
			date2: this.ruleForm.date2
		}
		localStorage.setItem('TimeCache10', JSON.stringify(TimeCache10))
		// this.next();

		// 全景调度列表，默认选中时间和商圈
		// console.log(d);
		this.next_date = d
	},
	mounted() {
		//判断是否默认设置商圈
		if (localStorage.getItem('s_time_slot') && localStorage.getItem('s_time_slot') != '') {
			this.s_time_slot = localStorage.getItem('s_time_slot').split(',')

			//重要：搜索的时候不联动 2020-10-28
			// 下面搜索框的区域进行联动
			// this.next_area_arr = this.area_arr;
			// this.next_area_id = this.area_id;
			// this.next_area_name = this.area_name;
		}
		this.getMerchants() //商户列表
		this.listUser() //店铺列表
		this.alljob_type()

		// if (this.status == 100) {
		//     this.listAbnormal();
		// } else {
		//     this.listShop();
		// }
		// this.getcenterList();//下面的列表数据
	},
	methods: {
		date(e) {
			return this.$moment().add('days', e).format('YYYY-MM-DD')
		},
		date_now(e) {
			var date = new Date()
			var seperator1 = '-'
			var seperator2 = ':'
			var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
			var strDate = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
			var currentdate =
				date.getFullYear() +
				seperator1 +
				month +
				seperator1 +
				strDate +
				' ' +
				date.getHours() +
				seperator2 +
				date.getMinutes() +
				seperator2 +
				date.getSeconds()
			return currentdate
		},
		time_dis(a, b) {
			// direct_time格式为yyyy-mm-dd hh:mm:ss 指定时间
			var now_time = Date.parse(new Date(a)) //指定时间的时间戳
			var end_time = Date.parse(new Date(b)) //指定时间的时间戳
			if (end_time < now_time) {
				console.log('时间差值0分钟')
				return 0
			} else {
				var time_dis = end_time - now_time
				var minutes = Math.floor(time_dis / (60 * 1000))
				console.log('时间差值' + minutes + '分钟')
				return minutes
			}
		},
		//获取商户列表
		getMerchants() {
			let fn = new FormData()
			this.$http.post(this.url + '/business/list', fn).then(
				res => {
					if (res.data.msg == '查询成功!' || res.data.code == '200') {
						if (res.data.data.list != null) {
							res.data.data.list.forEach(item => {
								item.value = item.name
							})
							this.merchantsList = res.data.data.list
						} else {
							this.merchantsList = []
						}
					} else if (res.data.code == '8886') {
						//code   8886  登录过期
						sessionStorage.clear()
						this.$alert('登录已过期，请重新登录 !', '提示', {
							confirmButtonText: '确定',
							callback: action => {
								window.location = 'login.html'
							}
						})
						return
					} else {
						this.$message.error(res.data.msg)
						return
					}
				},
				res => {
					this.$message.error('网络错误！')
					return
				}
			)
		},
		listUser() {
			//获取商铺列表
			let fn = new FormData()
			fn.append('sign_status', 30) //已合作的店铺
			fn.append('status', 1) //启用的店铺
			// fn.append("search_list", 1); //不进行分页
			this.$http.post(this.url + '/shop/getListForSearch', fn).then(
				res => {
					if (res.data.msg == '查询成功' || res.data.code == '200') {
						if (res.data.data != null) {
							res.data.data.list.forEach(item => {
								item.value = item.name
							})
							this.shopList = res.data.data.list
						} else {
							this.shopList = []
						}
					} else if (res.data.code == '8886') {
						//code   8886  登录过期
						sessionStorage.clear()
						this.$alert('登录已过期，请重新登录 !', '提示', {
							confirmButtonText: '确定',
							callback: action => {
								window.location = 'login.html'
							}
						})
						return
					} else {
						this.$message.error(res.data.msg)
						return
					}
				},
				res => {
					this.$message.error('网络错误！')
					return
				}
			)
		},
		listShop() {
			//判断时间框是否存在值
			if (this.ruleForm.date1 == null || this.ruleForm.date1 == '') {
				this.$message.error('请选择任务开始时间！')
				return
			}
			if (this.ruleForm.date2 == null || this.ruleForm.date2 == '') {
				this.$message.error('请选择任务结束时间！')
				return
			}

			//获取任务列表
			let fn = new FormData()
			fn.append('pageSize', this.pageSizeNow) //每页多少条
			fn.append('page', this.pageNum) //页数
			fn.append('task_sn', this.task_sn)
			fn.append('demand_sn', this.demand_sn)
			fn.append('staff_name', this.staff_name)
			fn.append('mobile', this.mobile)
			if (this.shop_name == '') {
				this.shop_id = ''
			}
			fn.append('shop_id', this.shop_id)
			// 多选操作，多个id
			var s_departmentIds_Arr = new Array()
			this.s_time_slot.forEach(element => {
				let [id, name] = element.split('|') // es6 数组解构赋值
				s_departmentIds_Arr.push(id.toString())
			})
			fn.append('area_id', s_departmentIds_Arr.toString())
			fn.append('label_id', this.label_id)
			if (this.status == 10) {
				fn.append('status', '10,60')
			} else {
				fn.append('status', this.status)
			}
			fn.append('time_type', this.time_type)
			if (this.ruleForm.date1 == null) {
				this.ruleForm.date1 = ''
			}
			fn.append('start_time', this.ruleForm.date1)
			if (this.ruleForm.date2 == null) {
				this.ruleForm.date2 = ''
			}
			fn.append('end_time', this.ruleForm.date2)
			//排序使用
			var order_obj = {
				shop_id: 1,
				start_time: 1
			}
			fn.append('order', JSON.stringify(order_obj))
			//鼠标移动-显示店铺信息
			fn.append('source', 'dispatch')
			this.$http.post(this.url + '/task/list', fn).then(
				res => {
					if (res.data.msg == '查询成功！' || res.data.code == '200') {
						if (res.data.data != null) {
							var demandList = res.data.data.list
							this.demandList = demandList
							this.total = res.data.data.count
							//当前选中状态的数量赋值
							//任务统计条数
							this.statistics_sum()
						} else {
							this.demandList = []
							this.total = 0
						}
					} else if (res.data.code == '8886') {
						//code   8886  登录过期
						sessionStorage.clear()
						this.$alert('登录已过期，请重新登录 !', '提示', {
							confirmButtonText: '确定',
							callback: action => {
								window.location = 'login.html'
							}
						})
						return
					} else {
						this.$message.error(res.data.msg)
						return
					}
				},
				res => {
					this.$message.error('网络错误！')
					return
				}
			)
		},
		listAbnormal() {
			//获取异常列表
			let fn = new FormData()
			fn.append('pageSize', this.pageSizeNow) //每页多少条
			fn.append('page', this.pageNum) //页数
			fn.append('status', 2) //[1]已处理 [2]未处理
			// 多选操作，多个id
			var s_departmentIds_Arr = new Array()
			this.s_time_slot.forEach(element => {
				let [id, name] = element.split('|') // es6 数组解构赋值
				s_departmentIds_Arr.push(id.toString())
			})
			fn.append('area_id', s_departmentIds_Arr.toString())
			// fn.append("area_id", this.area_id);
			if (this.ruleForm.date1 == null) {
				this.ruleForm.date1 = ''
			}
			if (this.ruleForm.date2 == null) {
				this.ruleForm.date2 = ''
			}

			if (this.abnormal_task_sn == '') {
				fn.append('start_time', this.ruleForm.date1)
				fn.append('end_time', this.ruleForm.date2)
			}

			fn.append('task_sn', this.abnormal_task_sn) //点击异常，携带过来的任务编号

			//要显示remark信息
			fn.append('source', 'dispatch')

			this.$http.post(this.url + '/abnormal/list', fn).then(
				res => {
					if (res.data.msg == '查询成功！' || res.data.code == '200') {
						if (res.data.data != null) {
							this.demandList = res.data.data.list
							this.total = res.data.data.count

							//任务统计条数
							this.statistics_sum()
							// //分页处理
							// if(this.total%10==1){
							//     this.pageNum-=1;
							// }
							// if(this.pageNum<=0){
							//     this.pageNum = 1;
							// }
						} else {
							this.demandList = []
							this.total = 0
						}
					} else if (res.data.code == '8886') {
						//code   8886  登录过期
						sessionStorage.clear()
						this.$alert('登录已过期，请重新登录 !', '提示', {
							confirmButtonText: '确定',
							callback: action => {
								window.location = 'login.html'
							}
						})
						return
					} else {
						this.$message.error(res.data.msg)
						return
					}
				},
				res => {
					this.$message.error('网络错误！')
					return
				}
			)
		},
		getcenterList() {
			//全景调度列表
			let fn = new FormData()
			fn.append('pageSize', this.pageSizeNow2) //每页多少条
			fn.append('page', this.pageNum2) //页数
			if (this.next_date == null) {
				this.next_date = ''
			}
			if (this.onStreamTimeStart == null) {
				this.onStreamTimeStart = ''
			}
			if (this.onStreamTimeEnd == null) {
				this.onStreamTimeEnd = ''
			}
			// fn.append("startTime", this.onStreamTimeStart);
			// fn.append("endTime", this.onStreamTimeEnd);
			// fn.append("task_id", this.next_task_sn)//任务id;
			// fn.append("name", this.next_name);
			// fn.append("mobile", this.next_mobile);
			// fn.append("job_areas", this.next_area_id);
			// fn.append("job_types", this.next_label_id);
			// fn.append("birthdayStart", this.next_start);
			// fn.append("birthdayEnd", this.next_next);
			// fn.append("gender", this.next_sex);
			// fn.append("work_date", this.next_date);
			fn.append('task_sn', this.next_task_sn)
			fn.append('is_appointment', this.is_appointment)
			fn.append('job_areas', this.next_area_id)
			// 多选操作，多个id
			// var s_departmentIds_Arr = new Array();
			// this.s_time_slot.forEach(element => {
			//     let [id, name] = element.split("|"); // es6 数组解构赋值
			//     s_departmentIds_Arr.push(id.toString());
			// });
			// fn.append("job_areas", s_departmentIds_Arr.toString());
			fn.append('job_types', this.next_label_id)
			fn.append('gender', this.next_sex)
			fn.append('work_date', this.next_date)
			fn.append('start_time', this.onStreamTimeStart)
			fn.append('end_time', this.onStreamTimeEnd)
			fn.append('age_start', this.next_start)
			fn.append('age_end', this.next_next)
			fn.append('mobile', this.next_mobile)
			fn.append('name', this.next_name)

			this.$http.post(this.url + '/dispatch/taskStaffList', fn).then(
				res => {
					if (res.data.msg == '查询成功' || res.data.code == '200') {
						if (res.data.data != null) {
							//对提示的文字进行处理
							res.data.data.list.forEach(item => {
								var stringResult = item.score_info.split(',')
								item.score_infos = this.objToArr(stringResult)
							})
							//表格的时间显示
							this.next_date2 = this.next_date
							this.centerLists = res.data.data.list
							this.total2 = res.data.data.count
						} else {
							this.centerLists = []
							this.total2 = 0
						}
					} else if (res.data.code == '201') {
						this.centerLists = []
						this.total2 = 0
					} else if (res.data.code == '8886') {
						//code   8886  登录过期
						sessionStorage.clear()
						this.$alert('登录已过期，请重新登录 !', '提示', {
							confirmButtonText: '确定',
							callback: action => {
								window.location = 'login.html'
							}
						})
						return
					} else {
						this.$message.error(res.data.msg)
						return
					}
				},
				res => {
					this.$message.error('网络错误！')
					return
				}
			)
		},
		//推荐原因的数组对象转换
		objToArr(obj) {
			var arr = []
			for (let i in obj) {
				let o = {}
				o['text'] = obj[i]
				arr.push(o)
			}
			return arr
		},
		//获取选中行的id
		handleSelectionChange(val) {
			// console.log('====');
			console.log(val)
			// console.log('====');
			// return false;
			if (this.status == 10) {
				if (val.length == 0) {
					//取消选中的多选框
					this.multipleSelection = ''
					this.recommend(1)
				} else {
					if (val.length >= 2) {
						// 删除索引为0的
						// console.log(val.splice(0,val.length-1),'被删除的')
						let arrays = val.splice(0, val.length - 1)
						arrays.forEach(row => {
							this.$refs.multipleTable.toggleRowSelection(row) //除了当前点击的，其他的全部取消选中
						})
					}
					//时间存储
					this.start_date_save = val[0].start_date
					this.next_shop_sn = val[0].shop_sn
					this.multipleSelection = val[0].task_sn
					//清空底部表格的部分搜索条件
					this.next_name = ''
					this.next_mobile = ''
					this.next_sex = ''
					this.next_start = ''
					this.next_next = ''

					//触发底部的推荐按钮
					// console.log(val[0]);
					this.next_task_sn = val[0].task_sn
					this.next_task_sn2 = val[0].task_sn
					this.next_date = val[0].start_date
					this.next_area_id = val[0].area_id
					// this.next_area_name = val[0].area_id+'|'+val[0].area_name;
					// this.next_area_arr = val[0].area_name;
					this.next_area_arr = val[0].area_id + '|' + val[0].area_name
					this.next_area_name = val[0].area_name
					this.recommend(2)
					// return false;
				}
			}
		},
		shearchBtn() {
			//本地进行存储区域
			localStorage.setItem('area_arr', this.area_arr)
			if (this.s_time_slot.length > 0) {
				localStorage.setItem('s_time_slot', this.s_time_slot)
			}

			//点击搜索按钮 - 任务sn置为空 - 清空勾选
			this.next_task_sn = ''
			if (this.status != 100) {
				//不是异常状态
				//重要：搜索的时候不联动 2020-10-28
				// 下面搜索框的区域进行联动
				// this.next_area_arr = this.area_arr;
				// this.next_area_id = this.area_id;
				// this.next_area_name = this.area_name;

				// 搜索
				this.pageNum = 1
				this.listShop() //上面列表数据
				this.pageNum2 = 1
				this.getcenterList() //下面的列表数据
			} else {
				//异常列表渲染
				//显示异常状态列
				this.abnormalshow = true
				//请求异常列表接口
				this.pageNum = 1
				this.listAbnormal()
			}

			//各个状态-本地时间存储
			localStorage.setItem(
				'TimeCache' + this.status,
				JSON.stringify({
					date1: this.ruleForm.date1,
					date2: this.ruleForm.date2
				})
			)
		},

		shearchBtn2() {
			//判断时间框是否存在值
			if (this.next_date == null) {
				this.$message.error('请选择要查询的日期！')
				return
			}
			// 搜索
			this.pageNum2 = 1
			this.getcenterList()
		},

		resetBtn() {
			//重置
			this.resetData() //重置请求数据
			this.pageNum = 1
			this.listShop()
		},

		resetBtn2() {
			//重置
			this.resetData2() //重置请求数据
			this.pageNum2 = 1
			this.getcenterList()
		},

		resetData() {
			//重置请求数据
			this.pageNum = 1
			this.task_sn = ''
			this.demand_sn = ''
			this.staff_name = ''
			this.mobile = ''
			this.type_arr = ''
			this.label_id = ''
			this.label_name = ''
			// this.area_arr = "";
			// this.area_id = "";
			// this.area_name = "";
			this.business_id = ''
			this.business_name = ''
			this.shop_id = ''
			this.shop_name = ''
			this.status = '10'
			//取消置灰，恢复正常
			this.task_sn_disabled = false //任务编号
			this.demand_sn_disabled = false //订单编号
			this.staff_name_disabled = false //接单人
			this.mobile_disabled = false //手机号
			this.shop_name_disabled = false //店铺名称
			//隐藏异常状态列
			this.abnormalshow = false
			//重置人才列表，且不可分配
			this.getcenterList()
			this.next_task_sn = ''
			this.next_task_sn2 = ''
			this.multipleSelection = ''

			// this.time_type = "";
			// this.ruleForm.date1 = "";
			// this.ruleForm.date2 = "";
			this.index = '10'
		},

		resetData2() {
			//重置请求数据
			this.pageNum = 1
			this.is_appointment = ''
			;(this.next_name = ''),
				(this.next_mobile = ''),
				// (this.next_date = ""),
				(this.onStreamTimeStart = ''),
				(this.onStreamTimeEnd = ''),
				(this.next_type_arr = ''),
				(this.next_label_id = ''),
				(this.next_label_name = ''),
				(this.next_sex = ''),
				(this.next_start = '')
			this.next_next = ''
			// (this.next_area_arr = ""), //商圈信息
			// (this.next_area_id = ""),
			// (this.next_area_name = "");
		},
		//在异常列表与任务列表数据获取之后
		statistics_sum() {
			let fn_statistics = new FormData()
			fn_statistics.append('pageSize', this.pageSizeNow) //每页多少条
			fn_statistics.append('page', this.pageNum) //页数
			fn_statistics.append('task_sn', this.task_sn)
			fn_statistics.append('demand_sn', this.demand_sn)
			fn_statistics.append('staff_name', this.staff_name)
			fn_statistics.append('mobile', this.mobile)
			fn_statistics.append('shop_id', this.shop_id)
			// 多选操作，多个id
			var s_departmentIds_Arr = new Array()
			this.s_time_slot.forEach(element => {
				let [id, name] = element.split('|') // es6 数组解构赋值
				s_departmentIds_Arr.push(id.toString())
			})
			fn_statistics.append('area_id', s_departmentIds_Arr.toString())
			// fn_statistics.append("area_id", this.area_id);
			fn_statistics.append('label_id', this.label_id)
			fn_statistics.append('time_type', this.time_type)
			fn_statistics.append('start_time', this.ruleForm.date1)
			fn_statistics.append('end_time', this.ruleForm.date2)
			//任务统计条数
			this.$http.post(this.url + '/task/statistics', fn_statistics).then(
				res => {
					if (res.data.msg == '请求成功' || res.data.code == '200') {
						if (res.data.data != null) {
							var statistic = res.data.data
							this.statistic.abnormal = statistic.abnormal //异常
							this.statistic.assigning = statistic.assigning //待分配（待确认+已撤销）
							this.statistic.withdraw = statistic.withdraw //已撤销
							this.statistic.assigned = statistic.assigned //待确认
							this.statistic.accept = statistic.accept //待签到
							this.statistic.checkin = statistic.checkin //进行中
							this.statistic.cancel = statistic.cancel //已取消
							this.statistic.finish = statistic.finish //已完成
							if (this.status == 100) {
								//异常
								this.statistic.abnormal = this.total //异常
								this.statistic.assigning = localStorage.getItem('assigning') //待分配（待确认+已撤销）
								this.statistic.withdraw = localStorage.getItem('withdraw') //已撤销
								this.statistic.assigned = localStorage.getItem('assigned') //待确认
								this.statistic.accept = localStorage.getItem('accept') //待签到
								this.statistic.checkin = localStorage.getItem('checkin') //进行中
								this.statistic.cancel = localStorage.getItem('cancel') //已取消
								this.statistic.finish = localStorage.getItem('finish') //已完成
							} else if (this.status == 10) {
								//待分配
								if (localStorage.getItem('abnormal') != null) {
									this.statistic.abnormal = localStorage.getItem('abnormal') //异常
								}
								this.statistic.assigning = this.total //待分配（待确认+已撤销）
								this.statistic.withdraw = 0 //已撤销
								if (localStorage.getItem('assigned') != null) {
									this.statistic.assigned = localStorage.getItem('assigned') //待确认
								}
								if (localStorage.getItem('accept') != null) {
									this.statistic.accept = localStorage.getItem('accept') //待签到
								}
								if (localStorage.getItem('checkin') != null) {
									this.statistic.checkin = localStorage.getItem('checkin') //进行中
								}
								if (localStorage.getItem('cancel') != null) {
									this.statistic.cancel = localStorage.getItem('cancel') //已取消
								}
								if (localStorage.getItem('finish') != null) {
									this.statistic.finish = localStorage.getItem('finish') //已完成
								}
							} else if (this.status == 20) {
								//待确认
								this.statistic.abnormal = localStorage.getItem('abnormal') //异常
								this.statistic.assigning = localStorage.getItem('assigning') //待分配（待确认+已撤销）
								this.statistic.withdraw = localStorage.getItem('withdraw') //已撤销
								this.statistic.assigned = this.total //待确认
								this.statistic.accept = localStorage.getItem('accept') //待签到
								this.statistic.checkin = localStorage.getItem('checkin') //进行中
								this.statistic.cancel = localStorage.getItem('cancel') //已取消
								this.statistic.finish = localStorage.getItem('finish') //已完成
							} else if (this.status == 30) {
								//待签到
								this.statistic.abnormal = localStorage.getItem('abnormal') //异常
								this.statistic.assigning = localStorage.getItem('assigning') //待分配（待确认+已撤销）
								this.statistic.withdraw = localStorage.getItem('withdraw') //已撤销
								this.statistic.assigned = localStorage.getItem('assigned') //待确认
								this.statistic.accept = this.total //待签到
								this.statistic.checkin = localStorage.getItem('checkin') //进行中
								this.statistic.cancel = localStorage.getItem('cancel') //已取消
								this.statistic.finish = localStorage.getItem('finish') //已完成
							} else if (this.status == 40) {
								//进行中
								this.statistic.abnormal = localStorage.getItem('abnormal') //异常
								this.statistic.assigning = localStorage.getItem('assigning') //待分配（待确认+已撤销）
								this.statistic.withdraw = localStorage.getItem('withdraw') //已撤销
								this.statistic.assigned = localStorage.getItem('assigned') //待确认
								this.statistic.accept = localStorage.getItem('accept') //待签到
								this.statistic.checkin = this.total //进行中
								this.statistic.cancel = localStorage.getItem('cancel') //已取消
								this.statistic.finish = localStorage.getItem('finish') //已完成
							} else if (this.status == 70) {
								//已取消
								this.statistic.abnormal = localStorage.getItem('abnormal') //异常
								this.statistic.assigning = localStorage.getItem('assigning') //待分配（待确认+已撤销）
								this.statistic.withdraw = localStorage.getItem('withdraw') //已撤销
								this.statistic.assigned = localStorage.getItem('assigned') //待确认
								this.statistic.accept = localStorage.getItem('accept') //待签到
								this.statistic.checkin = localStorage.getItem('checkin') //进行中
								this.statistic.cancel = this.total //已取消
								this.statistic.finish = localStorage.getItem('finish') //已完成
							} else if (this.status == 50) {
								//已完成
								this.statistic.abnormal = localStorage.getItem('abnormal') //异常
								this.statistic.assigning = localStorage.getItem('assigning') //待分配（待确认+已撤销）
								this.statistic.withdraw = localStorage.getItem('withdraw') //已撤销
								this.statistic.assigned = localStorage.getItem('assigned') //待确认
								this.statistic.accept = localStorage.getItem('accept') //待签到
								this.statistic.checkin = localStorage.getItem('checkin') //进行中
								this.statistic.cancel = localStorage.getItem('cancel') //已取消
								this.statistic.finish = this.total //已完成
							}

							localStorage.setItem('abnormal', this.statistic.abnormal)
							localStorage.setItem('assigning', this.statistic.assigning)
							localStorage.setItem('withdraw', this.statistic.withdraw)
							localStorage.setItem('assigned', this.statistic.assigned)
							localStorage.setItem('accept', this.statistic.accept)
							localStorage.setItem('checkin', this.statistic.checkin)
							localStorage.setItem('cancel', this.statistic.cancel)
							localStorage.setItem('finish', this.statistic.finish)
						}
						// else{

						// }
					} else if (res.data.code == '8886') {
						//code   8886  登录过期
						sessionStorage.clear()
						this.$alert('登录已过期，请重新登录 !', '提示', {
							confirmButtonText: '确定',
							callback: action => {
								window.location = 'login.html'
							}
						})
						return
					} else {
						this.$message.error(res.data.msg)
						return
					}
				},
				res => {
					this.$message.error('网络错误！')
					return
				}
			)
		},

		//跳转店铺列表
		shopLists(row) {
			const { href } = this.$router.resolve({
				path: '/shopList',
				query: { shop_name: row.shop_name, shop_id: row.shop_id }
			})
			window.open(href, '_blank')
		},

		// 跳转任务详情
		goToMore(row) {
			const { href } = this.$router.resolve({
				path: '/roleMain',
				query: {
					rl_id: row.demand_id,
					rl_sn: row.demand_sn,
					task_id: row.id,
					task_sn: row.task_sn,
					start_date: row.start_date
				}
			})
			window.open(href, '_blank')
		},

		// 跳转任务列表
		goToMoreList(row) {
			const { href } = this.$router.resolve({
				path: '/tasklist',
				query: { task_sn: row.task_sn, start: this.ruleForm.date1, end: this.ruleForm.date2 }
			})
			window.open(href, '_blank')
		},

		//店铺的自动完成
		querySearch(queryString, cb) {
			var restaurants = this.shopList
			var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants
			// 调用 callback 返回建议列表的数据
			cb(results)
		},
		createFilter(queryString) {
			return restaurant => {
				return restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
			}
		},
		handleSelect(item) {
			this.shop_id = item.id
		},

		//分页组件->子组件传值
		onChildValue(item) {
			this.pageNum = item[0]
			this.pageSizeNow = item[1]
			if (this.areaList.length > 0) {
				//上面的列表数据
				if (this.status == 100) {
					this.listAbnormal()
				} else {
					this.listShop()
				}
			}
		},

		//分页组件->子组件传值
		onChildValue2(item) {
			this.pageNum2 = item[0]
			this.pageSizeNow2 = item[1]
			if (this.areaList.length > 0) {
				//下面的列表数据
				this.getcenterList()
			}
		},

		//导出
		downloadOrder() {
			if (this.next_date == null) {
				this.next_date = ''
			}
			if (this.onStreamTimeStart == null) {
				this.onStreamTimeStart = ''
			}
			if (this.onStreamTimeEnd == null) {
				this.onStreamTimeEnd = ''
			}
			let obj = {
				token: JSON.parse(sessionStorage.getItem('manageInfo')).token,
				export: 2,
				task_sn: this.next_task_sn,
				is_appointment: this.is_appointment,
				job_areas: this.next_area_id,
				job_types: this.next_label_id,
				gender: this.next_sex,
				work_date: this.next_date,
				start_time: this.onStreamTimeStart,
				end_time: this.onStreamTimeEnd,
				age_start: this.next_start,
				age_end: this.next_next,
				mobile: this.next_mobile,
				name: this.next_name
			}
			let param = $.param(obj)
			window.location.href = this.url + '/dispatch/taskStaffList?' + param
		},
		changeBtndialogtype() {
			let [id, name] = this.type_arr.split('|') // es6 数组解构赋值
			this.label_id = id
			this.label_name = name
		},
		changeBtndialogtype_next() {
			let [id, name] = this.next_type_arr.split('|') // es6 数组解构赋值
			this.next_label_id = id
			this.next_label_name = name
		},
		//标签接口
		alljob_type() {
			let fn = new FormData()
			fn.append('label_type', 'job_type')
			this.$http.post(this.url + '/label/list', fn).then(
				res => {
					if (res.data.msg == '查询成功' || res.data.code == '200') {
						this.TypeArr = res.data.data
					} else if (res.data.code == '8886') {
						//code   8886  登录过期
						sessionStorage.clear()
						this.$alert('登录已过期，请重新登录 !', '提示', {
							confirmButtonText: '确定',
							callback: action => {
								window.location = 'login.html'
							}
						})
						return
					} else {
						this.$message.error(res.data.msg)
						return
					}
				},
				res => {
					this.$message.error('网络错误！')
					return
				}
			)
		},
		changeBtndialogarea() {
			// let [id, name] = this.area_arr.split("|"); // es6 数组解构赋值
			// this.area_id = id.toString();
			// this.area_name = name.toString();
			this.shearchBtn()
		},

		changeBtndialogarea_next() {
			let [id, name] = this.next_area_arr.split('|') // es6 数组解构赋值
			this.next_area_id = id
			this.next_area_name = name
		},
		// 获取商圈列表
		listArea() {
			let fn = new FormData()
			this.$http.post(this.url + '/area/list', fn).then(
				res => {
					if (res.data.msg == '查询成功' || res.data.code == '200') {
						if (res.data.data != null) {
							res.data.data.list.forEach(item => {
								item.value = item.area_name
							})
							this.areaList = res.data.data.list
							// 如果本地this.area_arr。存在值，那么不再赋予，如果不存在。赋予相关值
							// if (this.s_time_slot == '' || this.s_time_slot == null) {
							// 	// 默认选中非254-平谷的
							// 	this.areaList.forEach(element => {
							// 		// 平谷
							// 		if (element.area_name != '平谷') {
							// 			var pusharr = element.id + '|' + element.area_name
							// 			this.s_time_slot.push(pusharr)
							// 		}
							// 	})
							// }
						} else {
							this.areaList = []
						}
					} else if (res.data.code == '8886') {
						//code   8886  登录过期
						sessionStorage.clear()
						this.$alert('登录已过期，请重新登录 !', '提示', {
							confirmButtonText: '确定',
							callback: action => {
								window.location = 'login.html'
							}
						})
						return
					} else {
						this.$message.error(res.data.msg)
						return
					}
				},
				res => {
					this.$message.error('网络错误！')
					return
				}
			)
		},
		tagstate(e, abnormal_task_sn = '') {
			this.index = e
			this.status = e
			//默认时间选择
			if (e == 10) {
				//待分配
				//T T+1
				// 判断是否存在
				if (localStorage.getItem('TimeCache10') != {} && localStorage.getItem('TimeCache10') != null) {
					//存在
					this.ruleForm.date1 = JSON.parse(localStorage.getItem('TimeCache10')).date1
					this.ruleForm.date2 = JSON.parse(localStorage.getItem('TimeCache10')).date2
				} else {
					//不存在
					this.ruleForm.date1 = this.date(0) + ' 00:00:00'
					this.ruleForm.date2 = this.date(1) + ' 23:59:00'
				}
			} else if (e == 20) {
				//待确认
				//T T+1
				// 判断是否存在
				if (localStorage.getItem('TimeCache20') != {} && localStorage.getItem('TimeCache20') != null) {
					//存在
					this.ruleForm.date1 = JSON.parse(localStorage.getItem('TimeCache20')).date1
					this.ruleForm.date2 = JSON.parse(localStorage.getItem('TimeCache20')).date2
				} else {
					//不存在
					this.ruleForm.date1 = this.date(0) + ' 00:00:00'
					this.ruleForm.date2 = this.date(1) + ' 23:59:00'
				}
			} else if (e == 30) {
				//待签到
				//T-1 T
				// 判断是否存在
				if (localStorage.getItem('TimeCache30') != {} && localStorage.getItem('TimeCache30') != null) {
					//存在
					this.ruleForm.date1 = JSON.parse(localStorage.getItem('TimeCache30')).date1
					this.ruleForm.date2 = JSON.parse(localStorage.getItem('TimeCache30')).date2
				} else {
					//不存在
					this.ruleForm.date1 = this.date(-1) + ' 00:00:00'
					this.ruleForm.date2 = this.date(0) + ' 23:59:00'
				}
			} else if (e == 40) {
				//进行中
				//T-1 T
				// 判断是否存在
				if (localStorage.getItem('TimeCache40') != {} && localStorage.getItem('TimeCache40') != null) {
					//存在
					this.ruleForm.date1 = JSON.parse(localStorage.getItem('TimeCache40')).date1
					this.ruleForm.date2 = JSON.parse(localStorage.getItem('TimeCache40')).date2
				} else {
					//不存在
					this.ruleForm.date1 = this.date(-1) + ' 00:00:00'
					this.ruleForm.date2 = this.date(0) + ' 23:59:00'
				}
			} else if (e == 70) {
				//已取消
				//T-1 T
				// 判断是否存在
				if (localStorage.getItem('TimeCache70') != {} && localStorage.getItem('TimeCache70') != null) {
					//存在
					this.ruleForm.date1 = JSON.parse(localStorage.getItem('TimeCache70')).date1
					this.ruleForm.date2 = JSON.parse(localStorage.getItem('TimeCache70')).date2
				} else {
					//不存在
					this.ruleForm.date1 = this.date(-1) + ' 00:00:00'
					this.ruleForm.date2 = this.date(0) + ' 23:59:00'
				}
			} else if (e == 50) {
				//已完成
				//T-1 T
				// 判断是否存在
				if (localStorage.getItem('TimeCache50') != {} && localStorage.getItem('TimeCache50') != null) {
					//存在
					this.ruleForm.date1 = JSON.parse(localStorage.getItem('TimeCache50')).date1
					this.ruleForm.date2 = JSON.parse(localStorage.getItem('TimeCache50')).date2
				} else {
					//不存在
					this.ruleForm.date1 = this.date(-1) + ' 00:00:00'
					this.ruleForm.date2 = this.date(0) + ' 23:59:00'
				}
			} else if (e == 100) {
				//异常
				//T-1 T
				// 判断是否存在
				if (localStorage.getItem('TimeCache100') != {} && localStorage.getItem('TimeCache100') != null) {
					//存在
					this.ruleForm.date1 = JSON.parse(localStorage.getItem('TimeCache100')).date1
					this.ruleForm.date2 = JSON.parse(localStorage.getItem('TimeCache100')).date2
				} else {
					//不存在
					this.ruleForm.date1 = this.date(-1) + ' 00:00:00'
					this.ruleForm.date2 = this.date(0) + ' 23:59:00'
				}
			}
			if (e == 100) {
				this.abnormal_task_sn = abnormal_task_sn
				//除了商圈和时间，都置灰色
				this.task_sn_disabled = true //任务编号
				this.demand_sn_disabled = true //订单编号
				this.staff_name_disabled = true //接单人
				this.mobile_disabled = true //手机号
				this.shop_name_disabled = true //店铺名称
				//显示异常状态列
				this.abnormalshow = true
				//请求异常列表接口
				this.pageNum = 1
				this.listAbnormal()
			} else {
				//恢复正常
				this.task_sn_disabled = false //任务编号
				this.demand_sn_disabled = false //订单编号
				this.staff_name_disabled = false //接单人
				this.mobile_disabled = false //手机号
				this.shop_name_disabled = false //店铺名称
				//隐藏异常状态列
				this.abnormalshow = false
				//请求任务列表接口
				this.pageNum = 1
				this.listShop()
				//重置人才列表，且不可分配
				this.getcenterList()
				this.next_task_sn = ''
				this.next_task_sn2 = ''
				this.multipleSelection = ''
			}
		},
		// 任务取消-弹框确认
		addMenuBtn() {
			let fn = new FormData()
			fn.append('sn', this.sn) //相关id
			fn.append('reason_id', this.cancel.reason) //取消原因id
			fn.append('remark', this.cancel.bz) //取消备注

			this.$http.post(this.url + '/task/cancel', fn).then(
				res => {
					if (res.data.msg == '操作成功！' || res.data.code == '200') {
						this.$message.success(res.data.msg)
						this.hiddenRY()
						setTimeout(() => {
							this.listShop()
						}, 1000)
					} else if (res.data.code == '8886') {
						//code   8886  登录过期
						sessionStorage.clear()
						this.$alert('登录已过期，请重新登录 !', '提示', {
							confirmButtonText: '确定',
							callback: action => {
								window.location = 'login.html'
							}
						})
						return
					} else {
						this.$message.error(res.data.msg)
						return
					}
				},
				res => {
					this.$message.error('网络错误！')
					return
				}
			)

			//关闭弹框
			this.hiddenRY()
		},
		//任务撤销
		addCxBtn() {
			let fn = new FormData()
			fn.append('sn', this.sn) //相关id
			fn.append('reason_id', this.revoke.reason) //撤销原因id
			fn.append('remark', this.revoke.bz) //撤销备注

			this.$http.post(this.url + '/task/withdraw', fn).then(
				res => {
					if (res.data.msg == '操作成功！' || res.data.code == '200') {
						this.hiddenRY()
						this.$message.success(res.data.msg)
						setTimeout(() => {
							this.listShop()
						}, 1000)
					} else if (res.data.code == '8886') {
						//code   8886  登录过期
						sessionStorage.clear()
						this.$alert('登录已过期，请重新登录 !', '提示', {
							confirmButtonText: '确定',
							callback: action => {
								window.location = 'login.html'
							}
						})
						return
					} else {
						this.$message.error(res.data.msg)
						return
					}
				},
				res => {
					this.$message.error('网络错误！')
					return
				}
			)

			//关闭弹框
			this.hiddenRY()
		},
		//分配
		fenpeiBtn(e, index) {
			if (this.multipleSelection == '') {
				this.$message.error('请选择相关任务')
				return
			}
			this.demandInfowhere = e.demandInfowhere
			this.fp_staff_id = e.staff_id //人员id
			this.fp_staff_name = e.name //人员名
			this.fp_staff_sn = e.staff_sn //人员sn
			this.FPShowStop = true //分配任务
			this.diaTitle = '确认分配'
		},
		// 全景调度-第二次的弹框
		next() {
			// 直接分配
			this.assign(this.multipleSelection)
			// setTimeout(() => {
			//     if(this.AssignmentTips_reason.length==0){//没有分配提示的时候
			//         //打开第二个的弹框
			//         if(this.demandInfowhere!=null){
			//             this.NextShow = true;
			//             this.diaTitle = '该需求中的以下任务和该人才匹配，是否也要分配给该人才？';
			//         }
			//     }
			// }, 3000);
		},
		// 全景调度-第二次弹框的确认
		distribution() {
			//选中的行，进行分配
			if (this.multipleSelectionSelect == '') {
				this.$message.error('请选择相关任务！')
				return
			}
			this.demandInfowhere = null
			this.assign(this.multipleSelectionSelect.toString())
			this.NextShow = false
		},
		//获取选中行的id
		handleSelectionSelect(val) {
			this.multipleSelectionSelect = []
			val.forEach(item => {
				this.multipleSelectionSelect.push(item.sn)
			})
			this.multipleSelectionSelect = Array.from(new Set(this.multipleSelectionSelect))
		},
		//进行分配
		assign(e) {
			let fn = new FormData()
			fn.append('sn', e)
			fn.append('staff_sn', this.fp_staff_sn)
			fn.append('staff_name', this.fp_staff_name)
			fn.append('staff_id', this.fp_staff_id)
			fn.append('log_data', '')
			if (this.AssignmentTips == true) {
				fn.append('force', 1) //任务超过11小时，还是继续分配
			}

			this.$http.post(this.url + '/task/assigned', fn).then(
				// this.$http.post(this.url + '/task/issued', fn).then(
				res => {
					if (res.data.msg == '操作成功！' || res.data.code == '200') {
						this.$message.success(res.data.msg)
						setTimeout(() => {
							this.listShop()
							this.getcenterList()
						}, 1000)
						//打开第二个的弹框
						if (this.demandInfowhere != null) {
							this.NextShow = true
							this.diaTitle = '该需求中的以下任务和该人才匹配，是否也要分配给该人才？'
						}
					} else if (res.data.code == '8886') {
						//code   8886  登录过期
						sessionStorage.clear()
						this.$alert('登录已过期，请重新登录 !', '提示', {
							confirmButtonText: '确定',
							callback: action => {
								window.location = 'login.html'
							}
						})
						return
					} else if (res.data.code == '626') {
						//强制确认的弹框出现
						this.AssignmentTips = true
						this.AssignmentTips_reason = res.data.data
						return
					} else {
						this.$message.error(res.data.msg)
						return
					}
				},
				res => {
					this.$message.error('网络错误！')
					return
				}
			)
			this.hiddenRY()
		},
		//修改
		editBtn(e, index) {
			this.ids = e.id
			this.sn = e.task_sn
			this.index = index
			this.TaskEdit = true //修改任务
			this.diaTitle = '修改任务'
			// 查询任务详情
			let fn = new FormData()
			fn.append('id', this.ids)
			this.$http.post(this.url + '/task/info', fn).then(
				res => {
					if (res.data.msg == '查询成功' || res.data.code == '200') {
						var ask_info = res.data.data
						this.edit_task_sn = ask_info.sn
						this.edit_time1 = ask_info.start_time
						this.edit_time2 = ask_info.end_time
						this.edit_date = ask_info.hour_expect //计划时长
						this.edit_hour_actual = ask_info.hour_actual //实际时长
						if (ask_info.actual_end_time) {
							this.actual_end_time = ask_info.actual_end_time
						}
						if (ask_info.checkin_time == '0000-00-00 00:00:00') {
							this.edit_checkin_time = '' //签到时间
						} else {
							this.edit_checkin_time = ask_info.checkin_time //签到时间
						}
						if (ask_info.actual_start_time) {
							this.actual_start_time = ask_info.actual_start_time //计费开始时间
							this.actual_start_time2 = ask_info.actual_start_time //计费开始时间
						}
						this.edit_hour_delay = ask_info.hour_delay //延长时长
						this.edit_price = ask_info.checkin_time //价格
						if (ask_info.actual_end_time == '0000-00-00 00:00:00') {
							this.edit_finish_time = '' //完成时间
						} else {
							this.edit_finish_time = ask_info.actual_end_time //完成时间
						}
						if (ask_info.actual_end_time == '0000-00-00 00:00:00') {
							this.edit_finish_time2 = '' //完成时间
						} else {
							this.edit_finish_time2 = ask_info.actual_end_time //完成时间
						}
						if (this.edit_finish_time == undefined) {
							this.edit_finish_time = ''
						}
						if (this.edit_finish_time2 == undefined) {
							this.edit_finish_time2 = ''
						}
						// this.fp_staff_sn = ask_info.actual_end_time;
						this.edit_static = ask_info.status.toString()
						this.edit_static2 = ask_info.status.toString()
						this.amout_shop = ask_info.amout_shop
						// this.edit_finish_time = ask_info.actual_end_time
						// 实际时长计算
						// var checkin_time = ask_info.checkin_time;//签到时间
						// var finish_time = ask_info.finish_time;//完成时间

						// var checkin_time_times = new Date(checkin_time).getTime();
						// var finish_time_times = new Date(finish_time).getTime();

						// var endtimes = finish_time_times-checkin_time_times;
						// if(endtimes<=0){
						//     this.edit_hour_actual = 0;
						// }else{
						//     // 总秒数
						//     var second = Math.floor(endtimes / 1000);
						//     var hour = second / 3600;
						//     // 小时
						//     // var hr = Math.floor(second / 3600);
						//     var hr = hour.toFixed(2);
						//     if(window.isNaN(hr)==true){
						//         hr = 0;
						//     }
						//     this.edit_hour_actual = hr;
						// }
					} else if (res.data.code == '8886') {
						//code   8886  登录过期
						sessionStorage.clear()
						this.$alert('登录已过期，请重新登录 !', '提示', {
							confirmButtonText: '确定',
							callback: action => {
								window.location = 'login.html'
							}
						})
						return
					} else {
						this.$message.error(res.data.msg)
						return
					}
				},
				res => {
					this.$message.error('网络错误！')
					return
				}
			)
		},
		//取消
		redactBtn(e, index) {
			this.ids = e.id
			this.sn = e.task_sn
			this.index = index
			this.StateShowStop = true //状态关闭
			this.diaTitle = '取消任务'
		},
		//处理异常
		handle(e, index) {
			this.ids = e.id
			this.sn = e.abnormal_sn
			this.index = index
			this.StateShowhandle = true
			this.diaTitle = '处理异常'
		},
		//撤回
		withdraw(e, index) {
			this.ids = e.id
			this.sn = e.task_sn
			this.index = index
			this.StateShowcx = true //状态关闭
			this.diaTitle = '撤销任务'
		},
		//隐藏所有的弹框
		hiddenRY() {
			this.StateShowStart = false
			this.StateShowStop = false
			this.FPShowStop = false
			this.StateShowcx = false
			this.TaskEdit = false
			this.StateShowhandle = false
			this.AssignmentTips = false
			this.AssignmentTips_reason = []

			this.revoke.zrf = '' //责任方清空
			this.revoke.type = '' //类型清空
			this.revoke.reason = '' //原因清空
			this.revoke.bz = '' //备注清空
			this.revoke_type = [] //撤销类型列表清空
			this.revoke_reason = [] //撤销原因列表清空

			this.cancel.zrf = '' //责任方清空
			this.cancel.type = '' //类型清空
			this.cancel.reason = '' //原因清空
			this.cancel.bz = '' //备注清空
			this.cancel_type = [] //取消类型列表清空
			this.cancel_reason = [] //取消原因列表清空

			//修改输入框清空
			this.edit_task_sn = ''
			this.edit_time1 = ''
			this.edit_time2 = ''
			this.edit_date = '' //计划时长
			this.actual_end_time = ''
			this.edit_checkin_time = '' //签到时间
			this.actual_start_time = '' //计费开始时间
			this.actual_start_time2 = '' //计费开始时间
			this.edit_hour_delay = '' //延长时长
			this.edit_price = '' //价格
			this.edit_finish_time = '' //完成时间
			this.edit_finish_time2 = '' //完成时间
			this.edit_hour_actual = ''
			// this.fp_staff_sn = '';
			this.edit_static = ''
			this.edit_static2 = ''
			this.amout_shop = ''
		},
		recommend(index) {
			this.recommend_tag = index
			this.is_appointment = ''
			if (index == 2) {
				//推荐的按钮
				// 时间同步
				this.next_date = this.start_date_save
				this.next_task_sn = this.next_task_sn2
				if (this.next_task_sn != '') {
					//时间与商圈变为空
					// this.next_date = '';
					// this.next_area_arr = '';
					// this.next_area_id = '';
					// this.next_area_name = '';
					// 设置底部搜索栏中部分变灰
					;(this.next_date_disabled = true), //选择时间
						(this.onStreamTimeStart_disabled = true), //开始
						(this.onStreamTimeEnd_disabled = true), //结束
						(this.next_area_arr_disabled = true), //商圈
						(this.next_type_arr_disabled = true) //选择岗位
					this.next_sex_disabled = true //选择性别
					this.next_start_disabled = true //最小年龄
					this.next_next_disabled = true //最大年龄
					//执行推荐的接口
					this.pageNum2 = 1
					this.getcenterList()
				} else {
					this.$message.error('请选择相关任务！')
				}
			} else {
				//点击了全部
				// this.$refs.multipleTable.toggleRowSelection(); //全部取消选中
				// 恢复状态
				;(this.next_date_disabled = false), //选择时间
					(this.onStreamTimeStart_disabled = false), //开始
					(this.onStreamTimeEnd_disabled = false), //结束
					(this.next_area_arr_disabled = false), //商圈
					(this.next_type_arr_disabled = false) //选择岗位
				this.next_sex_disabled = false //选择性别
				this.next_start_disabled = false //最小年龄
				this.next_next_disabled = false //最大年龄
				//执行全部的接口
				this.pageNum2 = 1
				this.next_task_sn = ''
				this.getcenterList()
			}
		},
		recommend2() {
			this.recommend_tag = 3
			this.is_appointment = 1
			// 时间同步
			this.next_date = this.start_date_save
			this.next_task_sn = this.next_task_sn2

			if (this.next_task_sn != '') {
				this.getcenterList()
			} else {
				this.$message.error('请选择相关任务！')
			}
		},
		taskBtnEdit() {
			//任务修改
			let fn = new FormData()
			fn.append('id', this.ids)
			fn.append('sn', this.sn)
			fn.append('status', this.edit_static) //任务状态
			fn.append('checkin_time', this.edit_checkin_time) //签到时间
			fn.append('actual_start_time', this.actual_start_time) //计费开始时间
			fn.append('hour_delay', this.edit_hour_delay) //延时时长
			fn.append('finish_time', this.edit_finish_time) //结束时间
			fn.append('hour_actual', this.edit_hour_actual) //实际时长
			fn.append('amout_shop', this.amout_shop) //价格
			fn.append('finish_time_origin', this.edit_time2) //结束时间-固定传值

			this.$http.post(this.url + '/task/save', fn).then(
				res => {
					if (res.data.msg == '操作成功！' || res.data.code == '200') {
						this.$message.success(res.data.msg)
						this.listShop()
					} else if (res.data.code == '8886') {
						//code   8886  登录过期
						sessionStorage.clear()
						this.$alert('登录已过期，请重新登录 !', '提示', {
							confirmButtonText: '确定',
							callback: action => {
								window.location = 'login.html'
							}
						})
						return
					} else {
						this.$message.error(res.data.msg)
						return
					}
				},
				res => {
					this.$message.error('网络错误！')
					return
				}
			)
			this.hiddenRY()
		},
		handlenext() {
			//确定处理异常
			let fn = new FormData()
			fn.append('abnormal_sn', this.sn)

			this.$http.post(this.url + '/abnormal/save', fn).then(
				res => {
					if (res.data.msg == '操作成功！' || res.data.code == '200') {
						this.$message.success(res.data.msg)
						setTimeout(() => {
							this.listAbnormal()
						}, 1000)
					} else if (res.data.code == '8886') {
						//code   8886  登录过期
						sessionStorage.clear()
						this.$alert('登录已过期，请重新登录 !', '提示', {
							confirmButtonText: '确定',
							callback: action => {
								window.location = 'login.html'
							}
						})
						return
					} else {
						this.$message.error(res.data.msg)
						return
					}
				},
				res => {
					this.$message.error('网络错误！')
					return
				}
			)
			this.hiddenRY()
		},
		abelEadit() {
			if (this.edit_static == '50' && this.edit_static2 != '50') {
				this.edit_finish_time = this.date_now()
			} else {
				this.edit_finish_time = this.edit_finish_time2
			}
			//完成时间改变
			this.edit_finish_time_change()
		},
		//实际时长的计算
		difference(a, b) {
			console.log(a + '开始时间')
			console.log(b + '完成时间')
			var checkin_time_times = new Date(a).getTime()
			var finish_time_times = new Date(b).getTime()
			var endtimes = finish_time_times - checkin_time_times
			console.log(endtimes + '时间差')
			if (endtimes <= 0) {
				this.edit_hour_actual = 0
			} else {
				// 总秒数
				var second = Math.floor(endtimes / 1000)
				var hour = second / 3600
				// 小时
				var hr = hour.toFixed(2)
				if (window.isNaN(hr) == true) {
					hr = 0
				}
				console.log(hr + '时间差（小时）')
				this.edit_hour_actual = hr
			}
		},
		//进入单元行
		cellMouseEnter(row, column, cell, event) {
			publicData.isShowLoading = false
			// mainfun.endLoading();//清空加载框
			// if(row.staff_id!=this.mouseoverdata){
			// 请求人员资料信息
			let fn = new FormData()
			fn.append('staff_id', row.staff_id)
			fn.append('shop_sn', this.next_shop_sn)
			setTimeout(() => {
				this.$http.post(this.url + '/user/history', fn).then(
					res => {
						if (res.data.msg == '操作成功！' || res.data.code == '200') {
							var user_history = res.data.data
							if (user_history.avatar != undefined) {
								// 头像判断
								if (user_history.avatar == '') {
									user_history.avatar = this.head_url + 'images/160102759620181.png'
								} else {
									if (user_history.avatar.indexOf('https') == -1) {
										// 自己传的头像
										user_history.avatar = this.head_url + user_history.avatar
									} else {
										// 微信头像
										user_history.avatar = user_history.avatar
									}
								}
								this.user_history = user_history
							} else {
								this.user_history = {
									avatar: this.head_url + 'images/160102759620181.png',
									education: '无',
									level: 0,
									service_history: [],
									task_history: [],
									address: '',
									detailed_address: ''
								}
							}
						}
					},
					res => {}
				)
				// this.mouseoverdata = row.staff_id;
			}, 300)
			// }
		},
		// 离开单元行
		cellMouseLeave() {
			setTimeout(() => {
				publicData.isShowLoading = true
			}, 1000)
		},
		//进入单元行
		cellMouseEnterSD(row, column, cell, event) {
			console.log(row)
			publicData.isShowLoading = false
			// mainfun.endLoading();//清空加载框
			// if(row.staff_id!=this.mouseoverdataSD){
			// 请求人员资料信息
			let fn = new FormData()
			fn.append('work_date', this.next_date)
			fn.append('staff_sn', row.staff_sn)
			setTimeout(() => {
				this.$http.post(this.url + '/dispatch/staffScheduleList', fn).then(
					res => {
						if (res.data.msg == '操作成功！' || res.data.code == '200') {
							this.user_historySD = res.data.data.list
						}
					},
					res => {}
				)
				// this.mouseoverdataSD = row.staff_id;
			}, 300)
			// }
		},
		// 离开单元行
		cellMouseEnterSDLeave() {
			setTimeout(() => {
				publicData.isShowLoading = true
			}, 1000)
		},
		//跳转人才画像
		toPersonnelListHx(row) {
			const { href } = this.$router.resolve({ path: '/personnelListHx', query: { id: row.staff_id } })
			window.open(href, '_blank')
		},
		//跳转任务列表
		toTasklist(row) {
			// $router.push({path: '/tasklist',query:{name: row.name}})
			const { href } = this.$router.resolve({ path: '/tasklist', query: { name: row.name } })
			window.open(href, '_blank')
		},
		//签到时间改变
		edit_checkin_time_change() {
			if (this.edit_checkin_time != '') {
				if (this.actual_start_time2 == '0000-00-00 00:00:00') {
					console.log('?1')
					//实际结束时间-实际开始时间
					this.actual_start_time = this.edit_checkin_time //赋值于计费开始时间
					this.difference(this.actual_start_time, this.actual_end_time)
				} else {
					console.log('?2')
					//签到时间-任务开始时间>5的时候，则赋值
					// var cha = this.time_dis(this.actual_start_time2,this.edit_checkin_time);
					var cha = this.time_dis(this.edit_time1, this.edit_checkin_time)
					console.log(cha)
					if (cha >= 5) {
						console.log('?3')
						this.actual_start_time = this.edit_checkin_time //赋值于计费开始时间
					} else {
						this.actual_start_time = this.edit_time1 //赋值于计费开始时间
					}
					//实际结束时间-实际开始时间
					this.difference(this.actual_start_time, this.actual_end_time)
				}
			}
		},
		//完成时间改变
		edit_finish_time_change() {
			if (this.edit_finish_time != '') {
				this.actual_end_time = this.edit_finish_time
				this.difference(this.actual_start_time, this.actual_end_time)
			}
		},
		//跳转店铺-坐标
		shop_map(row, name) {
			window.open(
				'https://uri.amap.com/marker?position=' +
					row[0] +
					',' +
					row[1] +
					'&name=' +
					name +
					'&src=mypage&coordinate=gaode&callnative=0',
				'_blank'
			)
		},
		//全选-取消全选商圈
		selectAllArea() {
			let arr = []
			this.areaList.forEach(item => {
				arr.push(`${item.id}|${item.area_name}`)
			})
			if (this.areaStatus == true) {
				this.s_time_slot = arr
			} else {
				this.s_time_slot = []
			}
			this.areaStatus = !this.areaStatus
			// this.shearchBtn()
		}
	},
	filters: {
		ReversalTime: function (value) {
			value = value % 24
			return common.getReversalTime(value)
		},
		dateshear: function (value) {
			value = value.substr(10, 6).trim()
			return value
		}
	}
}
</script>

<style scoped>
@import '../../assets/style/abnormal.css';
</style>



// WEBPACK FOOTER //
// src/components/abnormal/List.vue